How can I control the handling of exceptions nested inside jsp: include Includes?
I have a JSP that includes another JSP via <jsp:include>
. I also have (what I think) a default error page setup. The problem is that when an exception is thrown inside an included file, it doesn't bubble up with the JSP included. Instead, it inserts an error page in the middle of the included JSP processing.
Oddly enough, it doesn't even insert the output of the error page into the error string. For example, if I throw an exception on line 600 of the included JSP, I see output from the first 300-400 lines, and then I view the error page (in the HTML output).
Instead of the first 300-400 lines of the included file appearing in such a case, what I would rather see is none of the included output pages per page, and only the error page output. Is this possible, or are there some include file buffering issues that prevent it?
Oh, and I've already tried setting "flush = 'true" on the include tag, and I've tried wrapping everything in try / catch on both includeer and includee ... but none of that worked.
a source to share
The original "bubble up" problem may be web container specific. We are using Websphere 7 and it works differently than other versions of Websphere: exclusions from the included page do not propagate back to the jsp include. If no error page is specified for the included page, the exception message is written to the output stream.
In the case of websphere 7, we found a followng parameter that allows us to exclude bubbles via jsp: include tag: com.ibm.ws.webcontainer.dispatcherRethrowSError from fixpack 15. Here is some additional information: http://pic.dhe.ibm.com/infocenter /wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Frweb_custom_props.html
In the case of other web containers, I haven't looked into this issue yet.
a source to share