File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Redirect browser location using servlets! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Redirect browser location using servlets!" Watch "Redirect browser location using servlets!" New topic
Author

Redirect browser location using servlets!

A Sam
Greenhorn

Joined: Aug 21, 2001
Posts: 13
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

Joined: Aug 17, 2001
Posts: 399
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:-)


Malhar Barai
SOA & Java Book
A Sam
Greenhorn

Joined: Aug 21, 2001
Posts: 13

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

Joined: Aug 23, 2001
Posts: 2
You could use javascript to redirect eg.
<html>
<head>
<script language="javascript">
top.location.href="/login.htm";
</script>
</head>
<body>
</body>
</html>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Redirect browser location using servlets!