minlog
article thumbnail
[ Spring Boot ] Thymeleaf
BackEnd/Spring Boot 2023. 3. 25. 16:39

Thymeleaf 순수 html 파일을 웹 브라우저에서 열어 내용 확인이 가능하다. 뷰 템플릿을 거치면 동적으로 변경된 결과를 확인 할 수 있다. 순수한 html을 유지하면서 동적 템플도 사용할 수 있는 타임리프의 특징을 네츄럴 템플릿이라고한다. 💡템플릿 설정 📑 build.gradle implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' 스프링 부트가 자동으로 ThymeleafViewResolver 와 필요한 스프링 빈들을 등록한다. 그리고 다음 설정도 사용한다. 이 설정은 기본 값 이기 때문에 변경이 필요할 때만 설정하면 된다. 📑 application.properties spring.thymeleaf.prefix=classp..