aspose file tools*
The moose likes Servlets and the fly likes A Standard Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "A Standard "Please Wait..." Page" Watch "A Standard "Please Wait..." Page" New topic
Author

A Standard "Please Wait..." Page

Peter Loew
Greenhorn

Joined: Jul 06, 2003
Posts: 27
Hi All,

Is there a standard way to implement a "please wait..." page? For example when filling out a form and pressing send it can take up to 30 secs to process the data, so I'd like to have a wait page displayed to the user.

I've seen other posts and many people seem to use the META tag to constantly refresh the page and check an attribute in the Session object. While I could do this, I was just wondering if there is a better more "accepted" way.

Thanks,

P
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

I opt for simplicity in such cases. When I feel a need to display a 'please wait' message, I simply use Javascript on the form submission event to reveal a previously hidden floating div with the 'pleae wait' message, and then let the browser run its course.

Simple, effective, and no server-side impact or polling.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
dema rogatkin
Ranch Hand

Joined: Oct 09, 2002
Posts: 294
If you can't use JS for some reason as a mobile device, e-mail preview pane and so on then you can use a page like
<html>
<HEADER>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=long_timeTaking_page">
</HEADER>
Please wait
</html>


Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
Originally posted by dema rogatkin:
If you can't use JS for some reason as a mobile device, e-mail preview pane and so on then you can use a page like
<html>
<HEADER>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=long_timeTaking_page">
</HEADER>
Please wait
</html>


Just a slight warning. This technique works fine if the "please wait" page has only text. If you add graphics, you can sometimes end up with "broken images". The reason for this is that the browser needs to fetch the images as separate requests, and will abandon those requests if it thinks the page containing them has been replaced by another.

If you have this problem, you can mitigate it in most cases by using a delay of 1 second, rather than the 0 mentioned above. For typical long-running processes this is usually no big deal.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A Standard "Please Wait..." Page
 
Similar Threads
In the SCJP Exam
Please wait message
Implementing "Page loading...Please wait"
Deadlock detected, timing out call after 90 seconds wait for thread Thread
How to show loading page in jsp