springboot2.0整合thymeleaf

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

猜你喜欢

转载自blog.csdn.net/lhc0512/article/details/79887796