Ok, I'm with it now I think, the two factors are the use of flush() (I'm not 
using that anywhere) and the buffer size, I probably exceed the buffer before 
the exception occurred.

You did call me out on my poor best practices, I do have too much unchecked 
code in my JSP, so thanks for pointing that one out, I'll improve those 
practices.

Thanks Chris and Charles for pointing me in the right direction!
David


-----Original Message-----
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Friday, July 30, 2010 8:14 AM
To: Tomcat Users List
Cc: Caldarale, Charles R
Subject: Re: Tomcat stops loading page half way through on runtime exception

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David,

On 7/29/2010 3:14 PM, Caldarale, Charles R wrote:
>> From: David Parks [mailto:davidpark...@yahoo.com]
>> Subject: Tomcat stops loading page half way through on runtime 
>> exception
>>
>> I'd much prefer a more consistent response (at this time, just the 
>> standard exception page).
> 
> What is "the standard exception page"? If you're referring to the 
> standard error page Tomcat generates, it can't send it if your webapp 
> has already committed all or a portion of the response (via flush(), 
> for example). You shouldn't be doing that until you know you're going 
> to be able to complete the processing of the request.

+1

Ideally, nothing during response generation should suffer a fatal error like 
this. Usually when this kind of thing happens, it's because someone is packing 
way too much logic into a JSP that really should be a servlet-then-JSP model.

>> Is there a way to ensure the exception page is displayed on 
>> exceptions (or in the future to ensure that the defined pretty error 
>> page is displayed)?
> 
> Fix your webapp to not send partial responses.  Nothing Tomcat can do if 
> you've already committed the response; there's no way to recall what you've 
> already sent.

+1

The other option is to use a /huge/ buffer, which is bad practice for a stable 
webapp.

"8k ought to be enough for anyone" ;)

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxS7CkACgkQ9CaO5/Lv0PBoXgCfY7Q9Z6bhTaWPi6qBh6crkA8z
gaAAoKSg7RI/JO/YAAmIHOrVQL00alRc
=Affv
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to