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了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章