003. 스프링부트 프로젝트 구조 이해
1. Web Application 일반적인 구성
- 디렉토리
- WEB-INF
- lib
- classes
- web.xml
2. Springboot 프로젝트 기본 구성
src/main/resources
- static : 정적 컨텐츠(image, html, css, js) 디렉토리
- static
- js
- css
- html
- images
favicon.ico
- templates : view 관련 jsp, thymeleaf, freemarker 등의 리소스 디렉토리입니다.
application.properties / application.yml
- 레거시 형태의 스프링 이용 시 서버를 추가하고 포트, 컨텍스트, 세션 타임 아웃, post 파일 사이즈, jndi 등을 설정했습니다. 스프링부트는 내장 was를 이용하기 때문에 기존 처럼 설정을 할 수가 없습니다. 대신 application.properties를 제공하며 간단 값 추가만으로 처리할 수 있습니다.
application.properties / application.yml은 서버 관련 설정 이외 많은 속성 들을 제공 합니다.
참고 : https://docs.spring.io/spring-boot/docs/2.5.1/reference/htmlsingle/#application-properties
Spring Boot Reference Documentation
This section goes into more detail about how you should use Spring Boot. It covers topics such as build systems, auto-configuration, and how to run your applications. We also cover some Spring Boot best practices. Although there is nothing particularly spe
docs.spring.io
application.properties 샘플
#web server
server.port=8080
server.contextPath=/
# graceful shutdown
server.shutdown=graceful
#SESSION
server.session.timeout=1800
#file updoad
#spring.http.multipart.enabled=true
#spring.http.multipart.max-file-size=10MB
#spring.http.multipart.max-request-size=10MB
spring.servlet.multipart.enabled=true
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB
## thymeleaf
spring.thymeleaf.prefix=classpath:templates/
spring.thymeleaf.check-template-location=true
spring.thymeleaf.suffix=.html
spring.thymeleaf.mode=HTML
spring.thymeleaf.cache=false
spring.thymeleaf.order=1
# INTERNATIONALIZATION (MessageSourceAutoConfiguration)
# Comma-separated list of basenames, each following the ResourceBundle convention.
spring.messages.basename=i18n/messages
# Loaded resource bundle files cache expiration, in seconds. When set to -1, bundles are cached forever.
#spring.messages.cache-seconds=-1
# Message bundles encoding.
spring.messages.encoding=UTF-8
# Set whether to fall back to the system Locale if no files for a specific Locale have been found.
spring.messages.fallback-to-system-locale=true