Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Prevent loading until .jsp page is finished processing  RSS feed

 
Mike Firkser
Ranch Hand
Posts: 249
Java Oracle PHP
  • 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.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
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.
 
Scott Selikoff
author
Bartender
Posts: 4081
21
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 ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!