如果将页面放在resources目录下的templates文件夹下,如果没有引入
spring-boot-starter-thymeleaf
依赖,就会发生这种情况,可以进入控制层代码,代码访问不了页面,浏览器报404页面没有找到
解决办法:
引入
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> <version>2.2.7.RELEASE</version> </dependency>
依赖