redirect.....after sometime

Hi,

My question is regarding the redirection.

I've a confirmation jsp page which is forwarded from a servlet. Once the confirmation page shows up...i need that page to redirect to login page say after 10 seconds....how can i accomplish this using java/jsp.


thank you.
LVL 10
jagadeesh_motamarriAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
Get it to write the meta tag to the page

http://webmaster.iu.edu/tool_guide_info/refresh_metatag.shtml
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mayank SAssociate Director - Product EngineeringCommented:
Not sure if meta is supported the same way on all browsers:

http://www.utoronto.ca/webdocs/HTMLdocs/NewHTML/meta.html

I prefer this in Javascript:

setTimeout ( "redirect ()", 10000 ) ;

function redirect ()
{
  window.location.replace ( "new URL" ) ;
}
0
CEHJCommented:
But JavaScript may not be enabled ;-)
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Mayank SAssociate Director - Product EngineeringCommented:
He he, CEHJ, I knew you'd say that ;-) but if it is enabled, I hope it works the same way on all browsers as long as the version is the same.
0
TimYatesCommented:
So the obvious solution is to do both ;-)

Do a META for 10 seconds, Javascript for 11 seconds, and add a link to the page for the user to click if neither is enabled ;-)

Tim
0
jagadeesh_motamarriAuthor Commented:
so if i go for javascript option....do i need to just specify that in the script tags...thatz it for something else...?
0
Mayank SAssociate Director - Product EngineeringCommented:
Yes.

<script language = "javascript" type = "text/javascript" >

write the functions here

</script>

Set one of the functions as the handler for your body's onload event.
0
Mayank SAssociate Director - Product EngineeringCommented:
>> Set one of the functions as the handler for your body's onload event.

In that one, you need to do: >> setTimeout ( "redirect ()", 10000 ) ;
0
TimYatesCommented:
it should be said though, that every browser (including WebTV) that I have had to use has accepted the META tag...  though not every browser has done javascript...
0
Mayank SAssociate Director - Product EngineeringCommented:
You're sure they handle it in the same manner (meaning http-equiv, url etc attributes don't change)?
0
TimYatesCommented:
as far as I have seen, yes...

I am sure there are some browsers that do not support it though, which is why a link should also be provided...
0
TimYatesCommented:
(I haven't tested anything on WebTV for a good 5 years or so it should be noted) ;-)

They might now support javascript...
0
CEHJCommented:
:-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.