1

我们在我们的网站上使用 sitemesh 进行装饰。我们有一个错误页面,我们不想将装饰器应用于它。如果发生异常(我们希望很少),就会出现错误页面,而不是 404,那是另一个页面。

错误页面通过spring控制器调用,在web.xml中定义如下:

<error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>/view/errorpage/display</location>
</error-page>

Sitemesh中的配置web.xml如下:

<filter-mapping>
    <filter-name>sitemesh</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

最后,错误控制器被排除在decorators.xml以下内容中:

<excludes>
    <pattern>/view/errorpage*</pattern>
</excludes>

但这并不能解决问题,因为装饰器页面仍在应用于错误页面。请问我有什么遗漏吗?

谢谢!

Krt_马耳他

4

1 回答 1

0

这提供了我的答案:

春季解决错误时如何排除sitemesh过滤器?

于 2011-06-10T06:22:12.447 回答