(1)在pom.xml中导入依赖:
<!--添加thymeleaf依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
在html文件上方添加Thymeleaf的头文件:
<html lang="en" xmlns:th="http://www.thymeleaf.org">
(2)取值:
(3)判断(if或者switch)
日期按照特定的格式显示:
(4)循环: