views:

175

answers:

1

I have a JSP, which includes another JSP via <jsp:include>. I also have (what I think is) a standard error page setup. The problem is that when an exception occurs inside the included file, it doesn't "bubble up" to the including JSP. Instead, it inserts the error page mid-way through processing the included JSP.

Strangely enough, it doesn't even insert the error page's output at the line the error occurred. For instance, if I cause an exception at line 600 of the included JSP, I'll see output from the first 300-400 lines, then see the error page (in the outputted HTML).

Instead of the first 300-400 lines of the included file appearing in such a case, what I'd much rather see is none of the included page's output appears at all, and just the error page output. Is this possible, or is there some issue with the buffering of included files that prevents it?

Oh, and I've already tried setting "flush='true'" on the include tag, and I've tried wrapping everything in try/catches on both the includer and includee ... but none of that helped.

A: 

Does using a large buffer (<%@ page buffer="1024kb" %>) and flush="false" for the include work?

Andrew Duffy
That worked great; thanks Andrew!
machineghost