You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2002/06/15 02:29:56 UTC

DO NOT REPLY [Bug 9856] - sendError(404) fails after getOutputStream() is called, if you have a custom 404 error-page

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9856>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9856

sendError(404) fails after getOutputStream() is called, if you have a custom 404 error-page

remm@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|Normal                      |Enhancement



------- Additional Comments From remm@apache.org  2002-06-15 00:29 -------
It depends on what your error page is doing. If the errorPage wants to use a
writer, then it will fail, because you already used the output stream in your
response. That limitation of the servlet API is arbitrary (Tomcat - esp 3.3 and
4.1 - would handle mixed output very well), but you seem to be running into it here.

The workaround is to have your error page use an output stream if the writer is
not available (assuming it is not a JSP).

Alternatly, it could be seen as a Tomcat limitation (the response state could be
fully reset when the forward is done), although this is not clear to me.

Marking as an enhancement.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>