Forums Register Login

Session.settimeOut using interceptor in struts2.0..

+Pie Number of slices to send: Send
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
A tiny monkey bit me and I got tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 774 times.
Similar Threads
use of interceptor
interceptor not working in struts 2
ActionInvocation.getAction() method
Get the exception object into Interceptor
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 01:56:03.