You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by shahed <sh...@enoor.com> on 2000/09/14 00:25:52 UTC
ErrorPage in JSP
I am trying to use the errorPage directive in a jsp page.
If there is any uncaught exception in page a.jsp, I get redirected
to errorpage.jsp
The only problem is that if I have output any HTML before the exception
is raised in a.jsp, that html is shown before the output of errorpage.jsp.
I have set the buffer="none" page directive in both a.jsp and
errorpage.jsp, but that does not work.
Thanks.
Shahed.
Re: ErrorPage in JSP
Posted by "David M. Karr" <dk...@tcsi.com>.
>>>>> "shahed" == shahed <sh...@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)