Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to delay response and than forward to another page?

 
Gul Khan
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sanjeev Kaushik
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic