Our app currently throws a custom UnavailableException from a couple of places
inside our Action handlers when the app is "offline" doing end-of-day
processing. We thought we had this situation covered from the UI perspective, as
we'd configured the following mapping in our web.xml:

    <error-page>
        <exception-type>UnavailableException</exception-type>
        <location>/unavailable.jsp</location>
    </error-page>

However, our end-of-day processing now shuts down our web server, which causes
the webapp to unload, and the unavailable.jsp to become inaccessible.  The
problem I've got is that if the user tries to access the webapp between the time
it has started unloading and the time the web server goes down, instead of our
unavailable.jsp, the user sees an ugly HTTP 500 error and a stack trace.

What I'd like to do, as it affects the smallest amount of code, is something
like the following:

    <error-page>
        <exception-type>UnavailableException</exception-type>
        <error-code>503</error-code>
    </error-page>

That is, if the container catches the UnavailableException, generate a standard
HTTP 503 error back to the browser.

Is something like this possible to do in web.xml? (I don't see it in the DTD.)
Or is my only option to catch the exception myself and do something like
HttpServletResponse.sendError(SC_SERVICE_UNAVAILABLE) in the code?

Thanks.

Jay

| Jay Burgess [Vertical Technology Group]
| http://www.vtgroup.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to