Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A Standard "Please Wait..." Page

 
Peter Loew
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64975
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
dema rogatkin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic