• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Server side redirect (301) - JSP :: How to set time delay before page redirect using

 
Suresh Gopi
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,

I want to show one page for 5 seconds and after that i want to redirect the page to another URL.

Got the code snippet for 301 redirection in JSP .

<%

response.setStatus(301);

response.setHeader( "Location", "http://www.new-url.com/" );

response.setHeader( "Connection", "close" );

%>


Please let me know how to set the time delay.

Is there any way to set the time delay using response.setHeader() method.

Note: I checked the possible HTTP response headers but couldn't find one to acheive this.

The above can be acheived using meta tag or script language but i want to do it in server side.

Is it possible?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am not sure,but what about Thread.sleep(1000) in server side ?

correct me if i am wrong
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by seetharaman venkatasamy:
i am not sure,but what about Thread.sleep(1000) in server side ? correct me if i am wrong
Umm, no. Not a very good idea.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
 
Bennet Xavier
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear Bibeault,

Thank You Very Much.

its really superb information.
 
Suresh Gopi
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Bear Bibeault.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Bear
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic