You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Joakim Verona <jo...@verona.se> on 2000/10/10 19:55:52 UTC
question about filled output buffers and error page
hello,
when an error occurs in jsp it is possible to send it to an error page with the errorpage directive.
however, if an error occurs after the page output buffer has recieved data, the error page
cant be displayed, and a message is displayed that says this.
Since this makes the errorpage feature nearly useless, i wonder if there is someway around this.
of cource, i can have my own try-catch blocks in my pages and do the handling myself, which is the way i do it now.
is there somewy of discarding the data in the buffer, or something?
--
Joakim Verona
joakim@verona.se
http://www.verona.se/
Re: question about filled output buffers and error page
Posted by Pierre Delisle <pi...@sun.com>.
Joakim Verona wrote:
>
> hello,
>
> when an error occurs in jsp it is possible to send it to an error page with the errorpage directive.
>
> however, if an error occurs after the page output buffer has recieved data, the error page
> cant be displayed, and a message is displayed that says this.
>
> Since this makes the errorpage feature nearly useless, i wonder if there is someway around this.
> of cource, i can have my own try-catch blocks in my pages and do the handling myself, which is the way i do it now.
>
> is there somewy of discarding the data in the buffer, or something?
I wouldn't say the feature is nearly useless. All that is required is that your buffer
be large enough to contain the page output up to the point where an exception
occurs.
The following directive allows you to set the page buffer to whichever size
you see fit:
<% page buffer="xxxkb" %>
If your pages are huge, you'd obviously want to try to have the logic that may
throw an exception to be executed as early as possible so that the buffer limit
is not exceeded.
-- Pierre
Re: question about filled output buffers and error page
Posted by Glenn Nielsen <gl...@voyager.apg.more.net>.
Another possible solution.
You can test to see if the output is already committed,
if the output is committed, do a redirect to the error page
you want to display.
Glenn
Joakim Verona wrote:
>
> hello,
>
> when an error occurs in jsp it is possible to send it to an error page with the errorpage directive.
>
> however, if an error occurs after the page output buffer has recieved data, the error page
> cant be displayed, and a message is displayed that says this.
>
> Since this makes the errorpage feature nearly useless, i wonder if there is someway around this.
> of cource, i can have my own try-catch blocks in my pages and do the handling myself, which is the way i do it now.
>
> is there somewy of discarding the data in the buffer, or something?
> --
> Joakim Verona
> joakim@verona.se
> http://www.verona.se/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
--
----------------------------------------------------------------------
Glenn Nielsen glenn@more.net | /* Spelin donut madder |
MOREnet System Programming | * if iz ina coment. |
Missouri Research and Education Network | */ |
----------------------------------------------------------------------