aspose file tools*
The moose likes Servlets and the fly likes How to delay response and than forward to another page? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to delay response and than forward to another page?" Watch "How to delay response and than forward to another page?" New topic
Author

How to delay response and than forward to another page?

Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173
Hi
I want to show the result of the servlet and than in 2 sec or some specified time want to forward to another page. can anyone tell me how to do that.
Thanks and Regards
Gul
maneesh subherwal
Ranch Hand

Joined: Aug 26, 2002
Posts: 42
Hello Gul,
An easy way to do this would be to add a javascript window timeout function onLoad that can do the forward for you.
setTimeout( "window.location.replace='http://www.javaranch.com'", 500);
the call below will forward to javaranch in 500 milliseconds i.e. 5 seconds.
I hope this helps you...
Thank you,
Maneesh


Sun Certified Java Programmer 2 (1.4)<br />Sun Certified Web Component Developer
Sanjeev Kaushik
Ranch Hand

Joined: Aug 01, 2002
Posts: 105
Another good way is to put this meta tag in HTML page
META HTTP-EQUIV="Refresh" CONTENT="5;URL=http://www.javaranch.com"
It will redirect to the site www.javaranch.com after 5 seconds.
Hope it helps.
Cheers,
Sanjeev


Sanjeev Kaushik
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to delay response and than forward to another page?