샘플 앱 관련 질문있습니다.
[초급편] 안드로이드 커뮤니티 앱 만들기(Android Kotlin)
삭제된 글입니다
- android
- kotlin
- firebase
173만명의 커뮤니티!! 함께 토론해봐요.
[초급편] 안드로이드 커뮤니티 앱 만들기(Android Kotlin)
삭제된 글입니다
토비의 스프링 부트 - 이해와 원리
import org.springframework.boot.web.servlet.ServletContextInitializer import org.springframework.boot.web.servlet.server.ServletWebServerFactory import org.springframework.web.context.support.AnnotationConfigWebApplicationContext import org.springframework.web.servlet.DispatcherServlet import kotlin.reflect.KClass class MySpringApplication( ) { companion object { fun run( applicationClass: KClass<*>, args: Array<String>, ) { val applicationContext = AnnotationConfigWebApplicationContext() applicationContext.register(applicationClass.java) applicationContext.refresh() val serverFactory = applicationContext.getBean(ServletWebServerFactory::class.java) val dispatcherServlet = applicationContext.getBean(DispatcherServlet::class.java) val webServer = serverFactory.getWebServer(ServletContextInitializer { it.addServlet("dispatcherServlet", DispatcherServlet(applicationContext)).addMapping("/*") }) webServer.start() } } } import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory import org.springframework.context.annotation.Bean import org.springframework.context.annotation.ComponentScan import org.springframework.context.annotation.Configuration import org.springframework.web.servlet.DispatcherServlet @Configuration @ComponentScan class DeepApplication { @Bean fun servletWebServerFactory() = TomcatServletWebServerFactory() @Bean fun dispatcherServlet() = DispatcherServlet() } fun main(args: Array<String>) { MySpringApplication.run(DeepApplication::class, args) } 예제 코드를 코틀린으로 변환했습니다. 마지막 코드는 부트 처음 생성 시 코드로 되돌아가면 됩니다. fun main(args: Array<String>) { runApplication<DeepApplication>(*args) }