Spring

Spring MVC

Jackerson 2022. 1. 20. 08:19

Project 생성

- Gradle, Jar, java 11

- SpringWeb, Thymeleaf, Lombok

 

Project 기본 세팅

- 생성된 프로젝트를 로드할 때는 반드시 build.gradle 파일로 로드

- annotation processing 사용

- build and run using, run tests using 은 인텔리제이 정식 버전인 경우 intellij IDEA로 하면 빠름

Welcome page

- src > main > resources > static > index.html

Bootstrap 활용

- src > main > resources > static > css > bootstrap.min.css 파일 넣기

- 서버 기동 시 파일 내용이 보이는것을 확인

- http://localhost:8080/css/bootstrap.min.css

- 위에서 css 내용이 안나오면 out폴더에서 해당 파일을 지우고 다시 빌드

@Data

- 사용시 주의가 필요하며, 가급적 @Getter @Setter 사용을 권장