【发布时间】:2015-03-17 14:42:58
【问题描述】:
我的应用程序在 Tomcat 7 上运行。
我创建了一个 url 重写过滤器,它正在侦听所有传入的请求,但是,当触发错误页面时,它不会过滤它,而是过滤发生错误的页面。
我在过滤器中设置了一个断点,当错误发生时,您可以看到它在源页面上触发。
但是显示的页面是/desktop/index.xhtml
这是预期的行为吗?
这是我的web.xml 配置:
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<error-page>
<error-code>500</error-code>
<location>/desktop/index.xhtml?messageId=4</location>
</error-page>
【问题讨论】:
标签: servlets servlet-filters custom-error-pages