tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Curwen" <gb_...@gb-im.com>
Subject using an error page for JSP pages and buffer flushing
Date Tue, 27 Apr 2004 19:53:56 GMT
I've defined an error page in web.xml:

<error-page>
  <exception-type>java.util.MissingResourceException</exception-type>
  <location>/error/locale.jsp</location>
</error-page>

Which works *most* of the time, for displaying that error page when I
have that Exception type.  But every so often, I get a partial HTML
response, and then the source just stops (cuts off).  In the local_host
log I see:

ErrorDispatcherValve[localhost]: Exception Processing ErrorPage
[exceptionType=java.util.MissingResourceException,
location=/error/locale.jsp]
java.lang.IllegalStateException

Which means (I'm assuming) that my JSP buffer has been flushed (which is
the partial page that I see in my browser) and the container itself is
causing the java.lang.IllegalStateException when it attempts to send me
off to the error page.
 
I have a couple questions regarding this area:

1)  I've attempted to add a <%@ page errorPage="/error/locale.jsp" %>
directive, and it seems to do the same thing. So is there no mechanism
that "more deftly" handles errors like this?  Or when we use any sort of
error-handling, will we have to also adjust our page buffer where
necessary?

2)  I don't like the idea of limiting myself to a single errorPage per
JSP page. There are many types of Exceptions that might occur in a page.
Well, perhaps not in a strict model-2 page ;) So I'd like to handle all
sorts of errors with the error-page mechanism.   Is there an accepted
'best practice' in regards to the usage of errorPage (JSP directive)
and/or error-page (in web.xml)?



------------------------------------------------
mike curwen                    
intermediate programmer
globally boundless

204 885-7733  ext 229
www.globallyboundless.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