tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Parks" <davidpark...@yahoo.com>
Subject RE: Tomcat stops loading page half way through on runtime exception
Date Sun, 01 Aug 2010 01:30:12 GMT
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:chris@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:davidparks21@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



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


Mime
View raw message