How to define general/fall-back error page in web.xml

My Java web app currently maps certain error codes to an error servlet (spring web flow, actually, but that should be besides the point), by doing this in web.xml:

<error-page>
    <error-code>500</error-code>
    <location>/spring/error?error=500</location>
</error-page>
<error-page>
    <error-code>404</error-code>
    <location>/spring/error?error=404</location>
</error-page>

However, in certain cases the server will still crash and give a stack trace dump of some exceptions to the user. (Running on IBM WebSphere btw). My question then is; is it possible to define a fall-back error page that will be used if all other errors don't match? So that we're guaranteed not to end up with a stack trace under any circumstance.

7
задан Rune Aamodt 18 February 2011 в 13:28
поделиться