Using Tomcat 4.0.1 (by necessity).
In my normal requests, I am generating a large amount of HTML through JSPs.
Because there's a lot of different stuff to generate, I have a main JSP which includes (using <jsp:include>) other JSPs, and they include other JSPs and so on, sometimes even inside a loop. (e.g. while (i++ < 100) { <jsp:include> })
I also have a very pretty error page that shows me lots of information about the request, session, etc. and is a complete HTML document in and of itself (i.e. has opening and closing html and body tags).
Hence, I want to set the buffer size of my responses quite high so that, should an error occur, even at the end of my excessively large page, any generated HTML will be cleared from the buffer and the whole error page will be shown just by itself, rather than appearing at the tail end of the part-generated HTML.
So, just to test it out, I'm setting the buffer size to 4MB. But it's not working.
I'm purposely generating an error to test it, and I get almost all (but not quite) of the generated content up to where the error is thrown, and then the content of the error page comes after that.
This should not be happening - I should ONLY be getting the content of the error page.
Saving the whole generated content to a file, I can see that the total size is about 210KB - much less than the 4MB buffer size I've specified.
I have put output into the error page to display the buffer size of the request object, and it has definitely been set to 4MB.
So, I'd very much like to figure out why Tomcat is committing the buffer much earlier than I think it should be.
Some things that might be causing this anomaly:
- I am setting the buffer size in a filter?
- My servlet forwards the request to the main JSP, which then includes further JSPs?
I can't see how either of these things would change the behaviour, though, as the error page quite clearly shows that the buffer size is 4MB.
The only thing I found searching the web that was even loosely related was a Tomcat ChangeLog saying "Ignore setBufferSize()/setLocale() calls on included response", but the log is for version 5 and I'm using version 4.
Any ideas you have about what's going wrong or even avenues that I might look down would be much appreciated.
I have already tried testing the setBufferSize() / <jsp:include> interaction on a smaller scale and it seemed to do what I expected - it just doesn't work with the real thing.
Thanks in advance,
Graham.
-- Graham Lea Software Engineer Forge Research Pty Ltd Suite G11, Bay 9, Locomotive Workshop Australian Technology Park, Cornwallis Street Eveleigh NSW 1430 Australia Phone: +61 2 9209 4152 Fax: +61 2 9209 4172 www.forge.com.au ---------------------------------------------------------------------- This message contains privileged and confidential information intended only for the use of the addressee named above. If you are not the intended recipient of this message you must not disseminate, copy or take any action in reliance on it. If you have received this message in error please notify the sender immediately. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of another (including a Body Corporate). ----------------------------------------------------------------------
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]