Hello,
I would like to display the contents in the browser then wait while an
object is being initialized and then display the remaining text. This
doesnt seem to work. The example JSP below sleeps for five seconds but
nothing is displayed until the whole JSP is executed. The method
flush()::java.io.PrintWriter works fine when I'm generating the same code
from a servlet but not in a JSP.

Does anyone know how to get around this problem?

Example:


<html>
<head>
<title>Test out.flush()</title>
</head>
<body>
<h1>Test out.flush()</h1>
<%
/*Display the contents so far, wait for five seconds, then continue the
execution and display the  rest of the document*/
out.println("Waiting 5 seconds...<br>");
out.flush();
try{
        Thread.sleep(5000);
}catch(InterruptedException interruptedException){
        out.println(interruptedException.getMessage());
        interruptedException.printStackTrace(out);
}
/*Displaying the remaining information*/
out.println("Ready!!");
%>
</body>
</html>



/Patrik

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to