Kai Hackemesser wrote:
> Hey,
>
> I have a question about out.flush(). I'm using Tomcat 3.2.
>
> In my JSP page there is a part which does hard database work, up to a minute
> until everything is done. I would like to show the user a status message
> about what is going on at the moment (such as "Updating table xxx",
> "Inserting in table yyy" etc.). But the JSP page appears on screen not
> before everything has been done. I tried to force output with out.flush(),
> but even then output doesn't come up until end.
>
> So my question is: how may I get the JSP output to screen at once?
>
One thing to watch out for is what the *browser* is doing to you, even if the
server is flushing the data as it should.
For example, let's say that you start writing the following text at the beginning
of your output page:
This is a "work in progress" message.
and, at this point, you call out.flush(). What will show up on your browser?
In current versions of Netscape (4.x), nothing at all! Why? Because you have
started a paragraph but have not completed it yet, so Netscape has no clue how to
format this data received so far -- until it sees the end of the current paragraph.
Moral of the story: be sure that you have ended your "work in progress" message
with text that tells the browser to go ahead and format what it knows. I generally
use a <br> or <hr> element for this kind of thing.
>
> ciao!
> Kai Hackemesser
>
Craig McClanahan
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets