This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JSP and the fly likes Server side redirect (301) - JSP :: How to set time delay before page redirect using Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Server side redirect (301) - JSP :: How to set time delay before page redirect using " Watch "Server side redirect (301) - JSP :: How to set time delay before page redirect using " New topic
Author

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

Suresh Gopi
Ranch Hand

Joined: Mar 08, 2007
Posts: 49
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?


Regards<br />Suresh
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Jan 10, 2002
Posts: 56542
    
  14

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56542
    
  14

Hint
Bennet Xavier
Ranch Hand

Joined: Jun 19, 2008
Posts: 162
Hi Bear Bibeault,

Thank You Very Much.

its really superb information.


Thanks And Regards

Bennet Xavier. X
Suresh Gopi
Ranch Hand

Joined: Mar 08, 2007
Posts: 49
Thanks a lot Bear Bibeault.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Thanks a lot Bear
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Server side redirect (301) - JSP :: How to set time delay before page redirect using
 
Similar Threads
sendRedirect problem!
How do I set redirect to a specific target
301 redirect in Resin ?
Page Caching...
How to remove browser cache after updating Jsp page on server