Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

out.flush() not working in jsp pages in new tomcat?

843836Nov 23 2004 — edited Nov 23 2004
I have a piece of code which I am using for testing apache. Essentially i need it to print out partial results to the web page before the complete jsp page has finished executing. I used to use apache 1.3x and oracle-jsp engine and with this configuration it seemed to work as expected when using the out.flush() command. Now that I have upgraded to tomcat 5.0.28 and apache 2.0 when I use out.flush() it has no effect and waits until all of the content for the page has been prepared before commiting it to the web browser. Here is my test program:
<%@ page language="java" import="java.util.*, java.rmi.*" %> 

<% for (int i=0; i <20; i ++) {

out.println("i="+i+"\n
");
out.flush();

try {
Thread.sleep(500);
} catch (Exception ex) {

}
}
%>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 21 2004
Added on Nov 23 2004
7 comments
738 views