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便可。