스프링부트에서는 src/main/resources/application.yml 파일에 설정들을 기술한다
기존의 web.xml + root-context.xml + servlet-context.xml을 대체한다.
서버가 시작될 때 먼저 application.yml을 읽고 시작된다.
application.yml은 라이브러리에 대한 설정도 할 수 있고 서버에 대한 설정도 할 수 있다.
예를 들어 서버의 포트를 설정하거나, context-path도 설정할 수 있다.
jpa의 hibernate에서 엔티티의 변수명을 그대로 설정하기 위해서 다음과 같은 설정을 할 수 있다.
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
'study > Spring boot' 카테고리의 다른 글
엉터리 정리 - @RestController와 @Controller (0) | 2021.03.23 |
---|---|
@Entity로 테이블 만들기 (0) | 2021.03.23 |
컨트롤러가 get 요청을 받을 때 (0) | 2021.03.23 |
엉터리 정리 - 스프링이 요청을 받는 방식, Maven, Lombok (0) | 2021.03.22 |
스프링 부트로 블로그 만들기(1) (0) | 2021.03.15 |