版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/nangeali/article/details/82344659
Thymeleaf
SpringBoot推荐Thymeleaf模板引擎
语法更简单,功能更强大
引入thymeleaf
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
不加版本号
默认版本为2.1.6
切换版本
节点,添加引用的版本
<thymeleaf.version>3.0.9.RELEASE</thymeleaf.version>
<thymeleaf-layout-dialect.version>2.2.2</thymeleaf-layout-dialect.version>
注意
布局功能的支持程序 thymeleaf3主程序
需要layout2以上版本
thymeleaf2对应于layout1
layout从2.0.0开始,为thymeleaf3设计
网址
https://github.com/ultraq/thymeleaf-layout-dialect/releases?after=2.0.3