javax.servlet.ServletException: Could not resolve view with name 'xxx/xxx' in servlet with name 'dispatcherServlet'


今天在调试后台管理系统时遇到这个bug,上网搜了好久也没找到,结果我在application.properties中添加

spring.resources.static-locations=classpath:/templates/
就搞定了,原因是springboot默认static中放静态页面,
而templates中放动态页面,而我想直接访问templates中的文件,所以报错了,在配置中添加后,就能正常访问了。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM