> -----Oorspronkelijk bericht-----
> Van: suviswan [mailto:[EMAIL PROTECTED]
> Verzonden: woensdag 10 maart 2004 10:20
> Aan: Tomcat Users List
> Onderwerp: HttpServletResponse.sendRedirect() closes the stream
> 
> 
> Hi
>         I am using Tomcat 4.1.29. When i do
> HttpServletResponse.sendRedirect() inside my servlet doGet(), it
> automatically closes the stream
>         So when i call the real close() function it throws IOException
> 
>                 java.io.IOException: The stream has been closed
>                 at
> org.apache.catalina.connector.ResponseStream.close(ResponseStr
> eam.java:219)
> 
>         Please let me know how to solve on this.


The easiest way would be not to call close() on the response's output
stream. Is there a reason you need to call close()?

The servlet spec says that sendRedirect has the side effect of committing
the response and terminating it. If the response is terminated, its
related OutputStream is closed, so it can not be closed again.


> 
> Thanks
> Surendra
> 

Regards,
Ronald.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to