在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了