首先看看你有没有添加thymeleaf的依赖,
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>
然后选择合适版本
<thymeleaf-spring5.version>3.0.9.RELEASE</thymeleaf-spring5.version>
<thymeleaf-layout-dialect.version>2.2.2</thymeleaf-layout-dialect.version>
然后在html页面看看有没有
<html lang="en" xmlns:th="http://www.thymeleaf.org">
这个得添加上,如果还没有提示,因为idea在更新,这时候可以去安装一个插件
这个插件记得安装上就可以解决了