1.先看一下是否有安装thymeleaf,如果没有就下载,然后重启一下IDEA。
2.首先在pom.xml中添加thymeleaf的依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
3.在html中添加
xmlns:th="http://www.thymeleaf.org"