I defined the error page in my web.xml:
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.jsp</location>
</error-page>
On this error page, I have my own tag that I created. The tag handler for this tag emails me a stack of any error. For the most part this works great.
In cases where it does not work perfectly, if the output has already been sent to the client at the time the error occurred. In this case, we get the following:
SEVERE: Exception Processing ErrorPage[exceptionType=java.lang.Exception, location=/error.jsp]
java.lang.IllegalStateException
I believe this error occurs because we cannot redirect the request to the error page after the exit is already running. The work I used was to increase the buffer size on especially large JSP pages. But I'm trying to write a generic error handler that I can apply to existing applications, and I'm not sure if you can go through hundreds of JSP pages, making sure their buffers are big enough.
Is there a way to allow execution of my stack trace mail code in this case, even if I cannot display the error page to the client?
source
share