创建项目时勾选了thymeleaf模板,pom.xml配置文件里面没有进行配置, 加上配置后刷新maven,重新访问就好使了 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>