How do you identify user session has been ended (at a particular time ) and forward a page to login page automatically

Showing Answers 1 - 4 of 4 Answers

laks

  • May 2nd, 2007
 

In the struts-config.xml you should have the entry success or failure. In the action class you should check if the session has timed out like if(session.timedOut=="true")
then ActionForward("success") ;

  Was this answer useful?  Yes

coolsiva

  • Sep 22nd, 2009
 

if(request.getRequestedSessionId() == null)
{
//user requesting for new session
//forward to loging page..
}
else if (!request.isRequestedSessionIdValid())
{
//user requesting for invalidated session so forward him to application session expiration page or //forward hime the login form again.
}
else(request.isRequestedSessionIdValid()){
    //forward him to the requested page.
}


add these code in any of the method like processActionPerform .. or any other method which overrides the controller or we can put in any of the filter..



Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions