RE: how do you identify user session has been ended (a...
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 ) ;
RE: how do you identify user session has been ended (at a particular time ) and forward a page to login page automatically
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..