一、前言:
市场上的模板引擎有很多如下:
JSP、Velocity、Freemarker、Thymeleaf
而SpringBoot推荐的Thymeleaf,其语法更简单,功能更强大
二、引入thymeleaf
在pom.xml文件下加入以下代码
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
切换thymeleaf版本
<properties>
<thymeleaf.version>3.0.9.RELEASE</thymeleaf.version>
<!-- 布局功能的支持程序 thymeleaf3主程序 layout2以上版本 -->
<!-- thymeleaf2 layout1-->
<thymeleaf-layout-dialect.version>2.2.2</thymeleaf-layout-dialect.version>
</properties>
学习内容来自尚硅谷