thymeleaf的配置
1、在springboto项目中使用thymeleaf标签,必须先添加依赖,如下。
org.springframework.boot
spring-boot-starter-thymeleaf
2、在application.properties中配置一些常用的thymeleaf,如下。
spring.thymeleaf.prefix=classpath:/templates/ spring.thymeleaf.check-template-location=true spring.thymeleaf.suffix=.html spring.thymeleaf.encoding=UTF-8 spring.thymeleaf.content-type=text/html spring.thymeleaf.mode=HTML5 spring.thymeleaf.cache=false