wood burning stoves 2.0*
The moose likes JSP and the fly likes Close window on JSP Session TIME-OUT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Close window on JSP Session TIME-OUT" Watch "Close window on JSP Session TIME-OUT" New topic
Author

Close window on JSP Session TIME-OUT

karthick ryan
Greenhorn

Joined: Jul 17, 2007
Posts: 19
ei Ranchers,
I need a urgent reply for the following issue.

On session time out, my page is directed to a login page (index.jsp). But instead I want the window to be closed

Why i need such a requirement is, I have a main page and various inks in that main page that pops up new child windows. Now, if the user is inactive in the child window and session timesout, I am getting the login page inside the child window, which should not happen..

Is there any control within the jsp like

onSessionTimeOut()
{
closewindow();
}


Thanks,
Rancher
Arvind Kamath
Greenhorn

Joined: Jul 17, 2007
Posts: 3
Hi,
Please try the below its a Java script
function logout() //you function name
{
window.close();
}
Regards,
Aravind
karthick ryan
Greenhorn

Joined: Jul 17, 2007
Posts: 19
Ya, window.close() closes the window.
But how will i know that the session has timed out?

I am mainly concerned on the condition to check whether session has expired.

thanks
Amit Kumargupta
Ranch Hand

Joined: Apr 13, 2007
Posts: 54
I think it you can not close the child window when the session is time out
because session is relate to user, when the session is expire it come to direct login page.
karthick ryan
Greenhorn

Joined: Jul 17, 2007
Posts: 19
But i dont want the login page. I want to close the window if the session is timed out(since user was inactive on the page).
Amit Kumargupta
Ranch Hand

Joined: Apr 13, 2007
Posts: 54
Use the HttpSessionListener

try this link

http://www.stardeveloper.com/articles/display.html?article=2001111901&page=1
http://www.roseindia.net/servlets/ListenerSession.shtml
karthick ryan
Greenhorn

Joined: Jul 17, 2007
Posts: 19
But is it not possible to check without these 2 classes being implemented. Cos, i dont want to update my jar files consisting of all the necessary class files.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41124
    
  45
Hello "dwky dwky",

please check your private messages.

Thanks,
Ulf


Ping & DNS - my free Android networking tools app
Katrina Owen
Sheriff

Joined: Nov 03, 2006
Posts: 1357
    
  17
Hi "google",

Please check your private messages.

Katrina Owen
Saloon Bartender
 
wood burning stoves
 
subject: Close window on JSP Session TIME-OUT
 
Similar Threads
How to call parent window id in child window
Javabean reference
How to maintain session in Both Parent window and child window
Need to avoid openging of page in a new window in IE
issue with session on restart of server