• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

out.flush()

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.)
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic