看依赖是否导入,极有可能是thymeleaf依赖未导入 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> 找了一节课 这个错误 哭了