• Post Reply Bookmark Topic Watch Topic
  • New Topic

Session.settimeOut using interceptor in struts2.0..  RSS feed

 
Sushant Gandhi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone, I ahve developed the project in struts 2 but i struct in one thing which is session time out code...Im use the interceptor for session timeout.....but this code is not run properly...when the session has been time out that time i want the one message print in console.....Here is the coding:

package com;

import java.util.Map;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;


public class SessionInterceptor extends AbstractInterceptor {
@Override
public String intercept(ActionInvocation invocation) throws Exception {

System.out.println("reached in interceptor class");

Map<String,Object> session = invocation.getInvocationContext().getSession();
// here is what can i put for run the code as after 1min will be terminate the session //
if(session.isEmpty())
{
System.out.println("Session has been timeout "+session.isEmpty());
return "session";
}

return invocation.invoke();
}

}

Please help me out of this
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!