Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/362.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java jQuery js文件未加载_Java_Javascript_Jquery_Spring_Servlets - Fatal编程技术网

Java jQuery js文件未加载

Java jQuery js文件未加载,java,javascript,jquery,spring,servlets,Java,Javascript,Jquery,Spring,Servlets,为什么我的自定义js正在加载但jquery-1.11.1.js未加载,尝试将其放置在与我的自定义js(StartPage.js)相同的文件夹中,但仍在firebug控制台上未找到其显示 <html> <head> <title>title</title> <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-1.11.1.js">

为什么我的自定义js正在加载但jquery-1.11.1.js未加载,尝试将其放置在与我的自定义js(StartPage.js)相同的文件夹中,但仍在firebug控制台上未找到其显示

<html>
<head>
    <title>title</title>
<script type="text/javascript" src="${pageContext.request.contextPath}/jquery-1.11.1.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/StartPage.js"></script>
</head>
<body>
    <%@ include file="/html/StartPage.html"%>
</body>
</html>

标题


尝试此路径并尝试清除broswer的缓存

您的路径中缺少“js”,请尝试以下路径

 ${pageContext.request.contextPath}/js/jquery-1.11.1.js
我的坏

我在eclipse中右键单击index.jsp来运行应用程序,这就是为什么它在解析js文件路径时会感到困惑,而StartPage.js是从Spring容器加载的,而/StartPage是从控制器的@RequestMapping中解析的


现在我在服务器上运行了整个项目,所有js文件的路径都已解析(使用${PageContext.request.contextPath})。

请尝试:${PageContext.request.contextPath}/js/jquery-1.11.1。js@thecbuilder,而不是通过查看源代码来了解这一点output@charlietfl你能详细说明你的评论路径显然是错误的,因此,基于输出进行调整我在清除浏览器缓存后也尝试了这种组合,但一个js如何从同一路径加载,而另一个js如何从同一路径加载,并且eclipse控制台上还有一件事给出了以下警告:org.springframework.web.servlet.PageNotFound noHandlerFound警告:未找到具有URI的HTTP请求的映射[/SpringRolls/js/jquery-1.11.1.js]在名为“spring”的DispatcherServlet中,尝试使用相对路径作为/js/jquery-1.11.1.js