springBoot页面无法跳转问题;
可以访问static下的index.html页面,无法访问templates下的index.html页面,
Could not resolve view with name 'xxx' in servlet with name dispatcherServlet
同时可能出现的问题:
Spring boot 报错:Circular view path [...]: would dispatch back to the current handler
解决方法:
引入thymeleaf而且要注意其版本号,最好将版本号注释,让其自动和前面引入的
spring-boot-starter-parent版本号保持一致
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-thymeleaf -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
<!--<version>1.4.0.RELEASE</version>-->
</dependency>
SpringBoot模板引擎配置
本文解决SpringBoot项目中,无法从dispatcherServlet访问templates文件夹下index.html的问题,介绍正确配置Thymeleaf的方法,确保视图解析无误。

2650

被折叠的 条评论
为什么被折叠?



