tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Hartung" <wi...@msoft.com>
Subject Re: wrestling with JSP error page
Date Fri, 21 Feb 2003 21:53:37 GMT
> From: <jeff.guttadauro@abbott.com>
> Sent: Friday, February 21, 2003 11:54 AM
> Subject: wrestling with JSP error page


>         Does anyone know of a way, besides maybe making the buffer size
> really huge, to get around this problem?  Would a Filter on the response
> help with this?  How would something like that work?  (Never written/used
> a Filter before)

What would you recommend? It's a generic mechanism. The problem you're
seeing is that content is already on its way down the socket and can't be
stopped, so you get your error within your code. HTTP doesn't support a "Oh,
Wait, just kidding, here's what I REALLY wanted to say" mode. It's fairly
stupid protocol that way.

How big a buffer do you need? What if Tomcat is streaming down a huge PDF
file and hits some kind of resource limit mid stream? Yuck!

Perhaps a better solution would be to restructure your code so that anything
that might throw an exception is done before you actually start streaming
the result. Granted, that's a lot more work.

However, setting the buffer size larger is legitimate, and perhaps something
you can do for development (no doubt your exception will Never Happen
Again). Set it to something more realistic for your application.

Regards,

Will Hartung
(willh@msoft.com)




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


Mime
View raw message