加载资源失败:服务器响应状态为 404(未找到)

新手上路,请多包涵

我无法解决我的链接问题。你能帮忙把 CSS 和 JS 文件链接起来吗?

CSS:

<link  href="../Jquery/jquery.multiselect.css" rel="stylesheet"/>
<link  href="../Jquery/style.css" rel="stylesheet" />
<link  href="../Jquery/prettify.css" rel="stylesheet" />

JS:

<script  src="../Jquery/jquery.multiselect.js"></script>
<script  src="../Jquery/prettify.js"></script>

错误:

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/RetailSmart/jsp/Jquery/jquery.multiselect.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/RetailSmart/jsp/Jquery/style.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/RetailSmart/jsp/Jquery/prettify.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/RetailSmart/jsp/Jquery/jquery.multiselect.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/RetailSmart/jsp/Jquery/prettify.js

请参阅此链接目录结构。

在此处输入图像描述

原文由 user3331535 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 2k
2 个回答

您的文件不在 jsp 文件夹 下,这就是找不到它的原因。

您必须再次返回 1 个文件夹

尝试这个:

 <script src="../../Jquery/prettify.js"></script>

原文由 Keensleeeeeeee 发布,翻译遵循 CC BY-SA 4.0 许可协议

请注意失败的 URL:

 Failed ... http://localhost:8080/RetailSmart/jsp/Jquery/jquery.multiselect.css

现在检查您的链接之一:

 <link href="../Jquery/jquery.multiselect.css" rel="stylesheet"/>

“../”是“包含目录”或“向上一个目录”的简写。这是一个 相对 URL。据推测,您在 /jsp// 中有一个文件,其中包含