SpringBoot thymeleaf模板版本,thymeleaf模板更換版本


SpringBoot thymeleaf模板版本

thymeleaf模板更換版本

修改thymeleaf模板版本

================================

©Copyright 蕃薯耀 2018年3月27日

http://www.cnblogs.com/fanshuyao/

 

一、SpringBoot 使用thymeleaf模板需要引用依賴的Jar包:

Xml代碼   收藏代碼
  1. <dependency>  
  2.   <groupId>org.springframework.boot</groupId>  
  3.   <artifactId>spring-boot-starter-thymeleaf</artifactId>  
  4. </dependency>  

 

二、SpringBoot中thymeleaf的默認版本為:1.5.10.RELEAS

Java代碼   收藏代碼
  1. <dependency>  
  2.   <groupId>org.springframework.boot</groupId>  
  3.   <artifactId>spring-boot-starter-validation</artifactId>  
  4.   <version>1.5.10.RELEASE</version>  
  5. </dependency>  

 

三、修改thymeleaf模板的版本

properties標簽加入如下配置:

Java代碼   收藏代碼
  1. <properties>  
  2.   <thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>  
  3.   <thymeleaf-layout-dialect.version>2.0.4</thymeleaf-layout-dialect.version>  
  4. </properties>  

 示例如下:

Xml代碼   收藏代碼
  1. <properties>  
  2.   <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  
  3.   <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>  
  4.   <java.version>1.8</java.version>  
  5.   <thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>  
  6.   <thymeleaf-layout-dialect.version>2.0.4</thymeleaf-layout-dialect.version>  
  7. </properties>  

 

注意:thymeleaf 版本3已經重寫,thymeleaf-layout-dialect必須為2以上的版本

 

 

(如果你覺得文章對你有幫助,歡迎捐贈,^_^,謝謝!) 

================================

©Copyright 蕃薯耀 2018年3月27日

http://www.cnblogs.com/fanshuyao/


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM