Hi,
As an aside, I would advise not using close pretty much ever, since you
don't know when another filter will process the response after your
servlet.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: suviswan [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, March 10, 2004 5:26 AM
>To: Tomcat Users List
>Subject: Re: HttpServletResponse.sendRedirect() closes the stream
>
>Hi
>
>----- Original Message -----
>From: "Ronald Wildenberg" <[EMAIL PROTECTED]>
>To: "'Tomcat Users List'" <[EMAIL PROTECTED]>
>Sent: Wednesday, March 10, 2004 3:00 PM
>Subject: RE: HttpServletResponse.sendRedirect() closes the stream
>
>
>> > -----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.
>>
>
>There is no need to close(). We have a servlet code which is based on
2.1
>spec and we are moving to 2.3 spec.
>The code worked fine in 2.1 and we thought it will work fine in 2.2.
>
>The code worked when we commented the close() call. Thanks for the
help.
>
>Regards
>Surendra
>
>
>>
>> >
>> > Thanks
>> > Surendra
>> >
>>
>> Regards,
>> Ronald.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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

Reply via email to