inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

이야기를 나눠요

173만명의 커뮤니티!! 함께 토론해봐요.

샘플 앱 관련 질문있습니다.

[초급편] 안드로이드 커뮤니티 앱 만들기(Android Kotlin)

삭제된 글입니다

  • android
  • kotlin
  • firebase
harry7408 댓글 1 좋아요 0 조회수 436

MySpringApplication 코틀린 변환 코드입니다.

토비의 스프링 부트 - 이해와 원리

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) }

  • spring
  • kotlin
김세준 댓글 0 좋아요 3 조회수 516

인기 태그

인프런 TOP Writers

주간 인기글