0

我不想显示自己的 404 页面。在 web.xml 我定义

<error-page>
    <error-code>404</error-code>
    <location>/WEB-INF/jsp/error/error404.html</location>
</error-page>

在我的过滤器中,我以下一个方式抛出此错误:

response.sendError(404);
System.out.println("telst log: 404");

在日志中,我看到了我的日志,但页面没有正确显示。布鲁斯打印

Oops! This link appears to be broken.

但是当我查看页面的源代码时,我的页面有html代码!!!

有人可以帮忙吗?谢谢。

brouser:克罗姆,IE。服务器 - JBoss 5.1

4

1 回答 1

2

阅读http://en.wikipedia.org/wiki/HTTP_404#Custom_error_pageshttp://www.thesitewizard.com/webdesign/google-chrome.shtml。如果自定义页面小于 512 字节,IE 和 Chrome 会用自己的 404 页面替换自定义页面。

于 2011-04-21T10:10:48.340 回答