I have written a custom interceptor for disabling back button functionality in browser. But code is not working. i have added meta tag in html also. I do not want to use java script for this.
public String intercept(ActionInvocation invocation) throws Exception {
final ActionContext actionContext = invocation.getInvocationContext();
HttpServletResponse response = (HttpServletResponse) actionContext.get(StrutsStatics.HTTP_RESPONSE);
if(response != null){
response.setHeader("Cache-Control", "no-cache, no-store");
response.setHeader("Pragma", "no-cache");
response.setHeader("Expires", "-1");
}
return invocation.invoke();
}
Can i write a custom interceptor which will check if user session is exists it will redirect on the same page from where user clicked browser back button.
Any suggestion how can i implement it.