【发布时间】:2015-01-01 08:56:42
【问题描述】:
我正在 Eclipse 上开发一个 webapp,这是文件系统目录结构:
myapp
- src
- build
- WebContent
- pages
- css
- images
- modules
- META-INF
- WEB-INF
当我使用 Tomcat(从 Eclipse 运行)运行这个 webapp 时,我可以在浏览器中加载 (myapp -> WebContent -> pages) 中包含的 jsp 页面,例如使用此 URL:
http://hostname:8080/myapp/pages/somepage.jsp
但问题是加载此类 somepage.jsp 中的 css 和图像失败。 在 somepage.jsp 的代码中,我以这种方式指出了 css:
<link href="../css/new_style.css" rel="stylesheet" type="text/css"/>
还有这样的图像:
<img src="../images/someimage.png"/>
问题是我不知道为什么没有加载这些图像和 css。
【问题讨论】:
标签: css eclipse jsp tomcat web-applications