Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Prevent loading until .jsp page is finished processing  RSS feed

 
Ranch Hand
Posts: 249
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to prevent a .jsp page from loading until after the entire page has been processed?

Here is the problem: Our web based app accesses a data base, and sometimes when there is a lot of data being returned, parts of the page (including images with links) appear before all the data has been processed and displayed. Sometimes impatient users will click these links which require data being returned. This really messes things up.

Any ideas/suggestions would be appreciated.

Thanks in advance.
 
Marshal
Posts: 67255
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Follow conventional accepted practices and perform all your processing up-front in a servlet controller which forwards to a JSP page to render the view after all the processing is complete.
 
author
Posts: 4106
24
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you're talking about preventing the output of a jsp until it is finished, not the loading. What you're describing is a form of auto-flushing. In the alternative, you can call out.flush() manually in order to send data to the user while processing is still going on.

In other cases, flush() is called automatically depending on the server settings such as if the buffer becomes too large or the page has finished loading. You can disable this feature by setting the page context autoFlush parameter to false. That should solve you're problem but you may need to manually call flush at the very end of processing of the JSP to re-enable the flush.
[ December 15, 2005: Message edited by: Scott Selikoff ]
 
Destiny's powerful hand has made the bed of my future. And this tiny ad:
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!