开发者

How to catch all error-codes at once

How can i catch all error-codes at once? i tried * but it didnt work.

<error-page>
  <error-code>javax.servlet.error.status_code</error-code&开发者_开发知识库gt;  
  <location>/default_error_page.html</location>
</error-page>


There is no way to do that according to the web.xml XSD. You'll have to specify each error code separately.


As Joseph mentioned, there is no way of doing that from the XSD, but* the way to do what you want is by using a filter. If the filter catches any exception, then you can return any content you want.

Of course this solution works as long as the server hasn't sent the headers back to the client.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜