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

SpringBoot thymeleaf模板版本java

thymeleaf模板更换版本spring

修改thymeleaf模板版本spring-boot

================================ui

©Copyright 蕃薯耀 2018年3月27日spa

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

 

1、SpringBoot 使用thymeleaf模板须要引用依赖的Jar包:blog

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

 

2、SpringBoot中thymeleaf的默认版本为:1.5.10.RELEASit

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>  

 

3、修改thymeleaf模板的版本io

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/

相关文章
相关标签/搜索