Re: Close the Stream

Chris Pratt <[email protected]> Tue, 4 Oct 2005 14:24:16 -0700
Newsgroups gmane.comp.java.sun.servlet
Message-ID <[email protected]>
------=_Part_11976_30412659.1128461056508
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Nope. I always do out of habit and because I consider it cleaner code, but
it is the Servlet Engine's responsibility to close the stream if you don't.
(*Chris*)

On 10/4/05, SUBSCRIBE EJB-INTEREST anonymous <[email protected]> wrote:
>
> Hi,
> I use HttpServletResponse's getOutputStream().println(String) to print a
> message in servlet.
> My question is do I have to close the stream before leaving the method.
> If not,will it impact the performance.
>
> Thanks in advance,
>
>
> _________________________________________________________________________=
__
> To unsubscribe, send email to [email protected] and include in the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html


------=_Part_11976_30412659.1128461056508
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Nope.&nbsp; I always do out of habit and because I consider it cleaner
code, but it is the Servlet Engine's responsibility to close the stream
if you don't.<br>
&nbsp; (*Chris*)<br><br><div><span class=3D"gmail_quote">On 10/4/05, <b cla=
ss=3D"gmail_sendername">SUBSCRIBE EJB-INTEREST anonymous</b> &lt;<a href=3D=
"mailto:[email protected]">[email protected]</a>&gt; wrote:</span><blockquote=
 class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); =
margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>I use HttpServletResponse's getOutputStream().println(String) to pri=
nt a<br>message in servlet.<br>My question is do I have to close the stream=
 before leaving the method.<br>If not,will it impact the performance.<br>
<br>Thanks in advance,<br><br>_____________________________________________=
______________________________<br>To unsubscribe, send email to <a href=3D"=
mailto:[email protected]">[email protected]</a> and include in the =
body
<br>of the message &quot;signoff SERVLET-INTEREST&quot;.<br><br>Archives: <=
a href=3D"http://archives.java.sun.com/archives/servlet-interest.html">http=
://archives.java.sun.com/archives/servlet-interest.html</a><br>Resources:=
=20
<a href=3D"http://java.sun.com/products/servlet/external-resources.html">ht=
tp://java.sun.com/products/servlet/external-resources.html</a><br>LISTSERV =
Help: <a href=3D"http://www.lsoft.com/manuals/user/user.html">http://www.ls=
oft.com/manuals/user/user.html
</a><br></blockquote></div><br>
___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".
<p>
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
<p>

------=_Part_11976_30412659.1128461056508--