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

278 篇文章 1 订阅
57 篇文章 0 订阅

SpringBoot thymeleaf模板版本

thymeleaf模板更换版本

修改thymeleaf模板版本

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

©Copyright 蕃薯耀 2018年3月23日

http://fanshuyao.iteye.com/

 

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

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

 

二、SpringBoot中thymeleaf的默认版本为:1.5.10.RELEAS

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-validation</artifactId>
  <version>1.5.10.RELEASE</version>
</dependency>

 

三、修改thymeleaf模板的版本

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月23日

http://fanshuyao.iteye.com/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值