错误 去出现这个错误是因为没有导入依赖。 解决方法 导入spring-boot-starter-thymeleaf依赖即可。 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> <version>2.2.2.RELEASE</version> </dependency>