tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@tcsi.com (David M. Karr)
Subject Re: ErrorPage in JSP
Date Wed, 13 Sep 2000 22:40:33 GMT
>>>>> "shahed" == shahed  <shahed@enoor.com> writes:

  shahed> I am trying to use the errorPage directive in a jsp page.

  shahed> If there is any uncaught exception in page a.jsp, I get redirected 
  shahed> to errorpage.jsp

  shahed> The only problem is that if I have output any HTML before the exception
  shahed> is raised in a.jsp, that html is shown before the output of errorpage.jsp.

  shahed> I have set the buffer="none" page directive in both a.jsp and
  shahed> errorpage.jsp, but that does not work.

Perhaps setting "buffer" to "none" is exactly the problem.  By doing
that, any output from the first JSP is immediately going to the
client.  If you leave out the "buffer" setting, it will get a default
buffer size of perhaps 8k, which may or not be enough to avoid
flushing data from the first JSP before it gets to the error page.
Depending on how much was output from the first page before you got
the error, you might have to increase the buffer setting to more than
8k.  This assumes you know ahead of time you're going to get an error
:) .  I doubt you'd ever really want to turn off buffering anyway.

-- 
===============================================================================
David M. Karr     ; dkarr@tcsi.com  ; w:(425)487-8312 ; TCSI & Best Consulting
Software Engineer ; Unix/Java/C++/X ; BrainBench CJ12P (#12004)


Mime
View raw message