• Post Reply Bookmark Topic Watch Topic
  • New Topic

out.flush()

 
james billa
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In my JSP page I am using out.flush() to display a message "search in progress.. please wait.." as my data search process takes long time to get the results back to the browser. It worked fine with my local JBOSS server/Eclipse IDE.

But when my code was deployed in production JBOSS server / Linux OS, the message is "search in progress.. please wait.." not appearing. Looks like out.flush() is ignored..

But the rest of the functionality works as expected. Any idea why it is so? Thanks in advance.

Below is my code

<DIV id = "InProgress">
<%out.write("<html> <p> <b> Search in progress.. Please wait... </b> </p> </html>"): %>
<%out.flush();%>
</DIV>
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is a really poor idea. As you have found, when buffered output actually appears on the browser is rather non-deterministic and not something you can rely upon.

I'd investigate using JavaScript to make such a message appear prior to submitting the long request. (I'd also consider adopting modern standards and not put Java code in JSP pages.)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!