Failed to load resource: the server responded with a status of 404 ()
php
GET http://localhost:8080/static/js/jquery-3.3.1.min.js net::ERR_ABORTED 404
css
isELIgnored="false"
)出現問題的片斷爲:html
<script src="${pageContext.request.contextPath }/static/js/jquery-3.3.1.min.js"></script>java
加入isELIgnored="false"
jquery
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>web
而後重啓服務器看看會不會還報這個錯spring
若使用SSM框架,請檢查:spring-mvc
springmvc.xml
是否正常加載?springmvc.xml
加載了使用漏寫<mvc:resources>
對靜態資源服務。具體作法參考How to use CSS, JavaScript and Images in Spring MVC | Java Web Tutor 對於使用了IDEA的朋友,請檢查是否out
目錄是否存在對應的js、css等靜態文件。服務器
若沒有,請打開Project Structure
,添加靜態文件所在目錄到Artifacts
-> Output Layout
中的<output root>
下。mvc
我目前的添加的static文件夾,所以我要添加static到<output root>
作法以下:
重啓TOMCAT便可。