스프링 스타터 프로젝트 bootweb1

Jmnote (토론 | 기여)님의 2016년 3월 20일 (일) 16:51 판 (→‎실행확인)

1 개요

SpringBoot 튜토리얼
스프링부트 시작하기
Spring Starter Project 튜토리얼
스프링 스타터 프로젝트 시작하기
  • "스프링 스타터 프로젝트"는 스프링부트 기반임
  • 여기서는 Web 모듈, Thymeleaf 모듈을 추가로 선택하여 사용
스프링부트 독립실행형 모듈(데몬)
Web 모듈 웹서비스 모듈(대략 톰캣)
Thymeleaf 모듈 뷰를 위한 템플릿 엔진

2 사전작업

3 새 프로젝트

  • Package Explorer의 빈공간에서 우클릭 --- New --- Spring Starter Project
  • "New Spring Starter Project" --- Name: HelloStarter --- Package: com.example.hello --- [Next >]
  • Template Engines --- [v] Thymeleaf
  • Web --- [v] Web
  • [Finish]

4 프로젝트 실행

  • Package Explorer --- HelloStarter 우클릭 --- Run As --- Spring Boot App
  • 하단 Console 창 확인
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.3.3.RELEASE)

2016-03-10 12:37:43.509  INFO 56 --- [           main] c.example.hello.HelloStarterApplication  : Starting HelloStarterApplication on WIN-DBOPKTBU0KB with PID 56 (C:\workspace\sts\HelloStarter\target\classes started by jmkim in C:\workspace\sts\HelloStarter)
2016-03-10 12:37:43.514  INFO 56 --- [           main] c.example.hello.HelloStarterApplication  : No active profile set, falling back to default profiles: default
2016-03-10 12:37:43.576  INFO 56 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@4ba2ca36: startup date [Thu Mar 10 12:37:43 KST 2016]; root of context hierarchy
2016-03-10 12:37:44.229  INFO 56 --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'beanNameViewResolver' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]
2016-03-10 12:37:44.930  INFO 56 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 99 (http)
2016-03-10 12:37:44.946  INFO 56 --- [           main] o.apache.catalina.core.StandardService   : Starting service Tomcat
2016-03-10 12:37:44.947  INFO 56 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.0.32
2016-03-10 12:37:45.053  INFO 56 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2016-03-10 12:37:45.053  INFO 56 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1481 ms
2016-03-10 12:37:45.352  INFO 56 --- [ost-startStop-1] o.s.b.c.e.ServletRegistrationBean        : Mapping servlet: 'dispatcherServlet' to [/]
2016-03-10 12:37:45.357  INFO 56 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'characterEncodingFilter' to: [/*]
2016-03-10 12:37:45.358  INFO 56 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2016-03-10 12:37:45.358  INFO 56 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2016-03-10 12:37:45.358  INFO 56 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'requestContextFilter' to: [/*]
2016-03-10 12:37:45.671  INFO 56 --- [           main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@4ba2ca36: startup date [Thu Mar 10 12:37:43 KST 2016]; root of context hierarchy
2016-03-10 12:37:45.753  INFO 56 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2016-03-10 12:37:45.754  INFO 56 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2016-03-10 12:37:45.786  INFO 56 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-03-10 12:37:45.786  INFO 56 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-03-10 12:37:45.825  INFO 56 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-03-10 12:37:45.954  INFO 56 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2016-03-10 12:37:46.032  INFO 56 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2016-03-10 12:37:46.038  INFO 56 --- [           main] c.example.hello.HelloStarterApplication  : Started HelloStarterApplication in 2.861 seconds (JVM running for 3.867)

5 실행확인

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Tue Mar 15 10:40:58 KST 2016
There was an unexpected error (type=Not Found, status=404).
No message available
→ URL을 풀어주는 곳이 없음. 구현하지 않았기 때문에.
→ 어쨌든 Web 모듈은 정상 작동하고 있음

6 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}