Thymeleaf 템 플 릿 설정

4700 단어 SpringBoot
SpringBoot 프로젝트 에서 Thymeleaf 템 플 릿 을 사용 하려 면 다음 과 같이 참조 해 야 합 니 다.
<dependency> 
<groupId>org.springframework.boot</groupId> 
<artifactId>spring-boot-starter-thymeleaf</artifactId> 
</dependency>

기본 설정 을 수정 할 때,변경 할 속성 을 application.properties 에 복사 하고 필요 한 값 으로 수정 하 십시오.예 를 들 어 템 플 릿 의 확장 자 를 수정 하고 기본 템 플 릿 경 로 를 수정 하 는 등 입 니 다.
# Enable template caching. 
spring.thymeleaf.cache=true 

# Check that the templates location exists. spring.thymeleaf.check-template-location=true 

# Content-Type value. 
spring.thymeleaf.content-type=text/html 

# Enable MVC Thymeleaf view resolution. spring.thymeleaf.enabled=true 

# Template encoding. 
spring.thymeleaf.encoding=UTF-8 

# Comma-separated list of view names that should be excluded from resolution. 
spring.thymeleaf.excluded-view-names= 

# Template mode to be applied to templates. See also StandardTemplateModeHandlers. 
spring.thymeleaf.mode=HTML5 

# Prefix that gets prepended to view names when building a URL.
spring.thymeleaf.prefix=classpath:/templates/ 

# Suffix that gets appended to view names when building a URL. spring.thymeleaf.suffix=.html 

# Order of the template resolver in the chain. 
spring.thymeleaf.template-resolver-order= 

# Comma-separated list of view names that can be resolved
spring.thymeleaf.view-names= 

좋은 웹페이지 즐겨찾기