在SpringBoot2.0整合thymeleaf,自动会整合thymeleaf3.0版本的,无需改thymeleaf的版本
在pom.xml的配置的如下
<!-- thymeleaf模版引擎,springboot2.0使用thymeleaf3.0 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
thymeleaf使用自动使用缓存的,故在开发阶段需要禁缓存,在application.yml的配置如下
spring
thymeleaf:
cache: false
接着就可以在template下写thymeleaf了