錯誤提示:
GET http://localhost:8080/ExpressManager/main/css/cityselect.css net::ERR_ABORTED 404
index.do:9 GET http://localhost:8080/ExpressManager/main/js/jquery-3.2.1.min.js net::ERR_ABORTED 404
index.do:1 GET http://localhost:8080/ExpressManager/main/image/backg.jpg 404

之前還是可以跑起來的,但是我加了這句話,運行就會出現現在的問題

最開始的想法是訪問路徑的問題,不斷則是,排除。
然后想到是配置文件 web.xml <servlet>問題,在不斷搜索中,排除。
最后,想起來之前遇到相似的問題,試了一下,成功。
------------------------------------------我的解決方案--------------------------------------------------------

<%
pageContext.setAttribute("APP_PATH", request.getContextPath());
%>
${APP_PATH }/
在最上面加一塊java代碼,在加載出錯的路徑前面加${APP_PATH }/
運行一下,問題解決。
原因嘛,我認為當前的訪問路徑有變化,這樣就可以,訪問css js 和圖片了。
