1.导入maven坐标
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring5</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-java8time</artifactId>
</dependency>
2.导入命名空间
xmlns:th="http://www.thymeleaf.org"
3.href要加上th:
4.连接加上@{}