检查你是否加载了启动包
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf </artifactId>
</dependency>
如果你是直接写的th 使用ALT+ Enter自己加载的 <html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
不报错 启动项目的时候可用但是没有提示
直接把html页面中的那句改为<html lang="en" xmlns:th="http://www.thymeleaf.org">
就有提示了