检门 1.5 +错误页面 +找不到css资源的相关路径
我在 wicket 和标准错误处理方面遇到了下一个问题:
所有 css 文件都存储为 java 资源,靠近 html 页面。 运行良好。但是,当我在 web.xml 中添加 404 错误处理以便任何 not-found-url 都被视为重定向到我的 PageNotFound.class 时,该页面中 css 的路径已损坏。它把它写成
<wicket:link>
<link rel="stylesheet" type="text/css" href="../../wicket/resource/com.web.common.PageNotFound/css/common.css"/>
</wicket:link>
而不是
<wicket:link>
<link rel="stylesheet" type="text/css" href="wicket/resource/com.web.common.PageNotFound/css/common.css"/>
</wicket:link>
(工作正常,如果我直接指向这个 PageNotFound 页面就会出现)
所以问题是 - 为什么只有在处理错误时它才会向 css 路径添加额外的无用的“../../”?
我按照此处描述的方式完成了所有操作(HTTP错误页面部分): 使用 wicket 添加自定义错误页面
I have the next problem with wicket and standard error handling:
all the css files are stored as java resources, near the html pages.
It's working fine. But, when I added the 404 error handling in the web.xml so that any not-found-url is treating as redirect to my PageNotFound.class - the paths to css in this page are broken. it's writes it as
<wicket:link>
<link rel="stylesheet" type="text/css" href="../../wicket/resource/com.web.common.PageNotFound/css/common.css"/>
</wicket:link>
instead of
<wicket:link>
<link rel="stylesheet" type="text/css" href="wicket/resource/com.web.common.PageNotFound/css/common.css"/>
</wicket:link>
(which is working fine, and appeared if I point directly to this PageNotFound page)
So the questions is - why only when error is handled it adds additional useless "../../" to css path?
I did all as it is described here (HTTP Error pages part): adding custom error pages using wicket
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看 https://issues.apache.org/jira/browse/WICKET-3602 。这可能是您的问题的原因。
Have a look at https://issues.apache.org/jira/browse/WICKET-3602. This might be the cause of your problem.