相关疑难解决方法(0)

引用位于JSP文件中的WEB-INF文件夹中的资源会在资源上返回HTTP 404

我有一个名为BookShopWeb的动态Web项目,我在eclipse中创建,具有以下目录结构

/BookShopWeb/|
  |--src
  |---WebContent
                | 
                |---META-INF
                |----WEB-INF---web.xml
                            |
                            |--css--styles.css
                            |--jsp---index.jsp 
Run Code Online (Sandbox Code Playgroud)

在web.xml中,我将起始页面设置为

<welcome-file-list>

<welcome-file>/WEB-INF/jsp/index.jsp</welcome-file>
Run Code Online (Sandbox Code Playgroud)

在index.jsp中,我将css包括在内

<head>
<link rel="stylesheet" type="text/css" href="../css/styles.css" />
</head>
Run Code Online (Sandbox Code Playgroud)

加载时索引页面不会显示css信息.我使用firebug检查了元素,它显示错误报告

Apache Tomcat/6.0.29 - Error report..
The requested resource (/css/styles.css) is not available.
Run Code Online (Sandbox Code Playgroud)

知道为什么会这样吗?我怎么能纠正这个?谢谢你

resources jsp web-inf

14
推荐指数
2
解决办法
3万
查看次数

标签 统计

jsp ×1

resources ×1

web-inf ×1