【发布时间】:2011-09-12 06:09:09
【问题描述】:
我们在网站上使用 sitemesh 进行装饰。我们有一个错误页面,我们不想将装饰器应用于它。出现异常时会出现错误页面(我们希望很少发生),而不是 404,这是另一个页面。
错误页面通过spring控制器调用,在web.xml中定义如下:
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/view/errorpage/display</location>
</error-page>
web.xml中的Sitemesh配置如下:
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
最后,decorators.xml 中排除了错误控制器,如下所示:
<excludes>
<pattern>/view/errorpage*</pattern>
</excludes>
但这并不能解决问题,因为装饰器页面仍在应用于错误页面。请问有什么遗漏的吗?
谢谢!
Krt_马耳他
【问题讨论】: