Dear Mike:

As I know, you can use out.flush() in some place so that user can see some
contents while waiting for long time processing to be finished. I don't
think it's
necessary. But for out.close(), I think it's better to add it all the time.
The rule
is, when you open a stream, better to close it after using it.

Regards
Liwen

----- Original Message -----
From: "Mike Haberman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 15, 2000 10:55 PM
Subject: is out.flush() or out.close() necessary ?


> In many of the "how to" books on servlets they never mention
> what to do with do with the response's PrintWriter after you
> are done writing to it.  Should it be closed, or at least flushed?
>
> i.e PrintWriter out = response.getWriter();
>
>
> On perhaps a related topic,  I get the following errors once in
> a while:
>
> [Mon May  8 15:33:51 2000] [error] [client x.x.x.104] Premature end of
script headers: /myservlet
>
> [Mon May  8 15:33:51 2000] [emerg] JServ: ajp12[1]: cannot scan servlet
headers
>  (500)
>
> [Mon May  8 15:33:51 2000] [error] JServ: an error returned handling
request via
>  protocol "ajpv12"
>
>
> Could this be because the output stream wasn't flushed ?
>
>
> thanks a ton!!
>
>
___________________________________________________________________________
> 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

Reply via email to