Thymeleaf 스프링 부트 설정

JeongHoHyun·2025년 2월 7일

Spring Boot

목록 보기
5/7

Thymeleaf 스프링 부트 설정

build.gradle

implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'

  • 위 라이브러리를 추가하면 스프링 부트가 자동으로 ThymeleafViewResolver와 필요한 스프링 빈들을 등록한다.

application.properties

spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html

  • 위 설정은 기본 설정이므로 처음에는 적혀있지않다.
  • 변경이 필요할 때 작성하여 설정하면 된다.
profile
Java Back-End 2022.11.01 💻~ing

0개의 댓글