本文主要是介绍【Spring Boot】jquery.js?v=1629896340433:3 GET http://localhost:8080/students/toPasswordPage 404,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
报错 GET http://localhost:8080/students/toPasswordPage 404
jquery.js?v=1629896340433:3 GET http://localhost:8080/students/toPasswordPage 404
由于 js 文件没有正确引入,导致页面的很多效果无法展示。
解决方案
- 直接检查页面中js的引入路径:
- 对比正常页面的路径:
通过对比发现同样引入js目录下的文件,出问题的路径中多了public目录,public是spring boot默认的静态资源文件夹之一。
关键是:${ctx.contextPath}
中已经包含了 public
根目录,所以导致资源找不到,去掉public即可!
小技巧:可以把
http://localhost:8989/public/js/students/password.js
路径放到浏览器中,或者直接放到浏览器中,试试能不能找到资源,尝试找到正确的路径~
参考:freemarker中的${ctx.contextPath}
这篇关于【Spring Boot】jquery.js?v=1629896340433:3 GET http://localhost:8080/students/toPasswordPage 404的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!