If the request has not been committed then the
ServletDispatcher is clever enough to do a dispatcher.forward() instead of
a dispatcher.include(). Therefore any uncommitted content in the buffer is
cleared. However, if the response is already committed
then there is no way to handle an
exception gracefully.
If you want to make sure errors are handled
gracefully then you must set a reasonably large response buffer size. The
WW2 IncludeTag also buffers all content, no matter how large, so if you use
this then your error pages should be displayed OK (at the expense of higher
memory use).
As an aside, I use a customised IncludeTag that
does not buffer the contents but I will replace this with the ActionTag now that
it supports executing a result.
My HandleExceptionAction detects if the response
has been committed and if so it merely writes "There has been an error while
executing the action" using the JspWriter (or the response writer if there is no
page context). It will then return NONE to indicate that no Result is to
be executed.
However, the normal case is where the response has
not been committed and a nice error page specific to the section of the site
where the error occurred is shown to the user.
I have tested this with both a committed response
and a non-committed response and it works fine.
John.
|
Title: Message
- [OS-webwork] ExceptionHandlerIntercepter John Patterson
- RE: [OS-webwork] ExceptionHandlerIntercepter Fred Lamuette
- Re: [OS-webwork] ExceptionHandlerIntercepter Francisco Hernandez
- RE: [OS-webwork] ExceptionHandlerIntercepter Jason Carreira
- RE: [OS-webwork] ExceptionHandlerIntercepter Fred Lamuette
- RE: [OS-webwork] ExceptionHandlerIntercepter John Patterson
- RE: [OS-webwork] ExceptionHandlerIntercepter Jason Carreira
- Re: [OS-webwork] ExceptionHandlerIntercepter John Patterson