• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Redirect browser location using servlets!

 
A Sam
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the session expires, I want the user to be send to login screen again.
But, if I use sendRedirect(target) from a frame in a browser, only that particular frame redirects to login screen.
How can I make the parent(browser) location move to the login screen by calling sendRedirect(target) from one of the frames?
Thanks!
-Sam
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear
u may continue using sendRedirect(target). but at the place where u put the link write the tag as:
< a href="../servlet/logout" target="_top">Logout
this would surely work.
good luck:-)
 
A Sam
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I do not have a link to be clicked by the user.
As soon as the session expires,the servlet redirects to login screen.
But it happens only in that particular frame. What can be done in the servlet redirection to make the Url of the browser or parent frame point to login screen.
Thanks
-Sam
 
Rob Godfrey
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use javascript to redirect eg.
<html>
<head>
<script language="javascript">
top.location.href="/login.htm";
</script>
</head>
<body>
</body>
</html>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic