【发布时间】:2011-02-01 01:43:18
【问题描述】:
背景
我正在开发一个应用程序(使用Spring MVC),其基本路径为:
http://localhost:8080/myapplication/
我有一个样式表 /css/style.css,我试图在 JSP 中将 absolute path 引用为:
<link rel="stylesheet" href="/css/style.css" type="text/css" media="screen, projection">
问题
样式表永远不会加载到浏览器中。当我通过浏览器的查看源代码功能跟踪样式表链接时,链接似乎是:
http://localhost:8080/css/style.css
应该是这样的:
http://localhost:8080/myapplication/css/style.css
我曾经在使用Struts 时使用html:rewrite 标记来解决此问题。 Spring MVC 中是否有任何等效的标签/技术?
感谢您的宝贵时间。
【问题讨论】:
标签: java html spring-mvc