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
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-thymeleaf</artifactId>
- </dependency>
2、SpringBoot中thymeleaf的默認版本爲:1.5.10.RELEASit
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-validation</artifactId>
- <version>1.5.10.RELEASE</version>
- </dependency>
3、修改thymeleaf模板的版本io
properties標籤加入以下配置:模板
- <properties>
- <thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>
- <thymeleaf-layout-dialect.version>2.0.4</thymeleaf-layout-dialect.version>
- </properties>
示例以下:
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <java.version>1.8</java.version>
- <thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>
- <thymeleaf-layout-dialect.version>2.0.4</thymeleaf-layout-dialect.version>
- </properties>
注意:thymeleaf 版本3已經重寫,thymeleaf-layout-dialect必須爲2以上的版本
================================
©Copyright 蕃薯耀 2018年3月27日
http://www.cnblogs.com/fanshuyao/