Except that there is the concept of buffered and unbuffered output. I am new
to servlets from the Perl CGI world where you must explicity unbuffer your
CGI output to get the behavior you are looking for. If not, the browser gets
all script output when you finish. This works for HTML as plain text
content. I'd have to think it can be done with servlets.
Alon
> -----Original Message-----
> From: Chris Pratt [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 26, 1999 10:04 AM
> Subject: Re: PrintWriter flush() with HTML/WML?
>
>
> Remember, there is only one stream going to the browser, and
> the browser is
> only expecting one document per connection. HTML wasn't
> designed for that
> type of communication. You probably want to use the meta tag
> that asks the
> browser to resubmit it's request after a few seconds (I can't
> remember which
> one, but you should be able to find it on the list). That
> way, the user's
> browser will get the "Please wait..." with a request to resubmit it's
> request in 10 seconds. It will then generate a separate
> document containing
> "Finished" on the subsequent request. The key is one
> document per request.
> (*Chris*)
>
> ----- Original Message -----
> From: Joona Palaste <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, August 26, 1999 6:55 AM
> Subject: PrintWriter flush() with HTML/WML?
>
>
> > Several people on this list have mentioned the method flush() of the
> > PrintWriter belonging to a HttpServlet's HttpResponse. This
> seems to work
> > right
> > only on plain text files, not markup languages like HTML or
> WML (Wireless
> > Markup Language).
> > Suppose I have this kind of code in my servlet's doGet() method...
> >
> > out.println("Please wait...");
> > out.flush();
> > long t=System.currentTimeMillis();
> > while (System.currentTimeMillis()<t+10000); // wait 10 seconds
> > out.println("Finished.");
> > out.close();
> >
> > If I have set the content-type to text/plain, it works like
> it should, the
> > text
> > "Please wait..." arrives right away and after 10 seconds, the text
> "Finished."
> > arrives. However, if I change the content-type to
> text/html, the browser
> just
> > waits 10 seconds, and then both lines arrive. It is the
> same with WML. As
> the
> > services I'm developing need markup languages, not plain
> text, I need some
> way
> > to output HTML or WML content with the flush() method, or a similar
> method. Is
> > there any way to do this?
> >
> > Joona Palaste
> >
> >
> ______________________________________________________________
> _____________
> > 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