더북(TheBook)

위의 명령을 실행하면 다음 출력과 유사한 결과를 볼 수 있다.

 

$ spring run app.groovy

Resolving dependencies..

:: Spring Boot :: (v1.1.4.RELEASE)

INFO 84872 --- [runner-0] .t.TomcatEmbeddedServletContainerFactory : Server initialized with port: 8080

INFO 84872 --- [runner-0] o.apache.catalina.core.StandardService : Starting service Tomcat

INFO 84872 --- [runner-0] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/7.0.54

INFO 84872 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext

INFO 84872 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2030 ms

INFO 84872 --- [runner-0] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080/http

INFO 84872 --- [runner-0] o.s.boot.SpringApplication : Started application in 7.086 seconds (JVM running for 7.599)

 

이제 웹 브라우저에서 URL로 http://localhost:8080을 입력하면 그림 1-3과 같은 화면을 볼 수 있다. 스프링 부트는 app.groovy 파일을 실행할 때 해야 할 일을 안다. 스프링 부트는 웹 컨텍스트를 생성하고 지정된 애너테이션을 기초로 모든 요청에 응답한다.

신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.