my dog learned polymorphism*
The moose likes Struts and the fly likes Waiting Page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Waiting Page" Watch "Waiting Page" New topic
Author

Waiting Page

Jonathan Lister
Greenhorn

Joined: Feb 22, 2004
Posts: 12
My struts project produces reports from a database. Some of the queries take a while to return all their results, in the meantime the user sees a blank page. Is there a way to display a "Please wait" page while the query runs, which is then replaced by the results page when the query is completed.
Srikanth Shenoy
author
Ranch Hand

Joined: Jan 24, 2004
Posts: 184
You might want to check this article by Kyle.
http://www.javaranch.com/newsletter/200403/Journal200403.jsp#a4
If you are just using Tomcat, then adopt the first part of the article using the browser's auto-refresh feature.


Srikanth Shenoy
Author of Struts Survival Guide : Basics to Best Practices
brad balmer
Ranch Hand

Joined: Mar 08, 2004
Posts: 57
Another good way of doing this is by using a <div> tag initially setting it to NOT be visible. Using the javascript nsubmit, make the div visible and when the page changes the 'Please Wait' image goes away.
Srikanth Shenoy
author
Ranch Hand

Joined: Jan 24, 2004
Posts: 184
Originally posted by Brad Balmer:
Another good way of doing this is by using a <div> tag initially setting it to NOT be visible. Using the javascript nsubmit, make the div visible and when the page changes the 'Please Wait' image goes away.

Brad,
That solution has a glitch. The DIV does not necessarily make trips back to the server, which means the long running transaction times out after a while since the browser feels that the site is down. Sometimes the web server times out the socket connection since it has not receieved any response from the application server. Hence it is essential to make the heartbeat check. This is exactly what the auto-refresh does.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Waiting Page