1. 程式人生 > >SSM框架下 Failed to load resource: the server responded with a status of 404 (Not Found)錯誤

SSM框架下 Failed to load resource: the server responded with a status of 404 (Not Found)錯誤

fail mvc pre 絕對路徑 The pat server spa nbsp

這個錯誤提示的是js的引用路徑有錯:

1.檢查應用路徑是否正確(我的問題是路徑是正確的但是去到頁面就會提示404錯誤)

引用路徑,最好都使用絕對路徑

<script type="text/javascript" src="<%=basePath%>/js/jquery-1.12.4.js"></script> 

2.在SSM框架下面查看配置文件

<mvc:resources location="/js/" mapping="/js/**"></mvc:resources>

SSM框架下 Failed to load resource: the server responded with a status of 404 (Not Found)錯誤