This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Redirecting to Login page on session timeout!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Redirecting to Login page on session timeout!!" Watch "Redirecting to Login page on session timeout!!" New topic
Author

Redirecting to Login page on session timeout!!

harsha av
Greenhorn

Joined: Sep 02, 2004
Posts: 17
Hi,
I am trying to redirect an application to its login page on session timeout. The main page is divided into 3 frames, top ,left, and right.
The right frame contains the form that is filled by the user, and which is submitted to a servlet A.

At this point in servlet A, i am checking whether the session is valid, if not , i redirect to the Login page.
The problem is , the Login page is loading in the right frame and not in the complete window.

Any pointers to how it can be resolved is greatly appreciated.

Also, is it possible for automatically redirecting the application to the Login page without any programatic checks..ie is it possible to associate a session timeout with a particular page ?

Regards,
Harsha
Purushoth Thambu
Ranch Hand

Joined: May 24, 2003
Posts: 425
You can't do this using server side scripting. Have to call the below function in the frameset onload method

function clearframe()
{
if(window.parent != window.self)
{
window.parent.location.href=window.location.href;
}
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Redirecting to Login page on session timeout!!
 
Similar Threads
Session Management
redirecting to a new page when session expires
Session Expire due to time out: Please Help
Handling session timeout and session invalidate differently
redirecting to a new page when session expires