Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

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.
0
jagadeesh_motamarri
Asked:
jagadeesh_motamarri
  • 5
  • 4
  • 3
  • +1
3 Solutions
 
CEHJCommented:
Get it to write the meta tag to the page

http://webmaster.iu.edu/tool_guide_info/refresh_metatag.shtml
0
 
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now