SpringMVC找不到JS文件

博客讲述了在使用SpringMVC时遇到的404错误,问题在于SpringMVC DispatcherServlet无法找到JS文件。浏览器控制台显示jquery-1.11.0.min.js和json2.js加载失败,导致$未定义的引用错误。错误原因是DispatchServlet将'/js/'路径误认为HTTP请求,未找到映射。解决方法是配置SpringMVC以处理静态资源请求。
摘要由CSDN通过智能技术生成

 SpringMVC找不到JS文件,搞了半天。

浏览器控制台报错信息:

jquery-1.11.0.min.js Failed to load resource: the server responded with a status of 404 (Not Found)
json2.js Failed to load resource: the server responded with a status of 404 (Not Found)
converter:10 Uncaught ReferenceError: $ is not defined

控制台报错信息:

23:26:19,033 WARN  [org.springframework.web.servlet.PageNotFound] (default task-5) No mapping found for HTTP request with URI [/springmvc/js/jquery-1.11.0.min.js] in DispatcherServlet with name 'springmvc'
23:26:19,043 WARN  [org.springframework.web.servlet.PageNotFound] (default task-6) No mapping found for HTTP request with URI [/springmvc/js/json2.js] in DispatcherServlet with name 'springmvc'

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值