thymleaf 설정 시 yml 파일

2023. 12. 28. 22:32
728x90

application.yml파일에 

 

spring:
  thymeleaf:
    enabled: true
    cache: false
    prefix: classpath:/templates/
    suffix: .html
    encoding: UTF-8
    mode: HTML

추가.

 

1) enabled : Thymeleaf 템플릿 엔진을 사용할지 여부 (true - 활성화)

2) cache : Thymeleaf 템플릿 캐시 사용 여부 (false - 비활성화)

3) prefix : 타임리프 템플릿 파일 위치 경로 지정. html 파일이 있는 경로를 설정해준다 (resources> templates>안의 html 파일들)

4) suffix : 타임리프 템플릿 파일의 확장자 지정.  (.html 확장자 파일들임)

5) encoding : 타임리프 템플릿 파일의 인코딩 설정 (UTF-8)

6) mode : 타임리프의 모드 설정 (HTML 모드)

728x90

BELATED ARTICLES

more