@@ -0,0 +1,845 @@
+package com.pavi.javaheart.interceptor;%0A%0Aimport java.util.Map;%0A%0Aimport com.opensymphony.xwork2.ActionInvocation;%0Aimport com.opensymphony.xwork2.ActionSupport;%0Aimport com.opensymphony.xwork2.interceptor.Interceptor;%0Aimport com.pavi.javaheart.bean.User;%0A%0Apublic class AuthenticationInterceptor implements Interceptor%7B%0A%0A%09@Override%0A%09public void destroy() %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09%0A%09%7D%0A%0A%09@Override%0A%09public void init() %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09%0A%09%7D%0A%0A%09@Override%0A%09public String intercept(ActionInvocation actionInvocation) throws Exception %7B%0A%09%09 Map%3CString, Object%3E session=actionInvocation.getInvocationContext().getSession();%0A%09%09 %0A%09%09 User user=(User) session.get(%22user%22);%0A%09%09 System.out.println(%22In Inteceptor%22+user);%0A%09%09 if(user ==null)%0A%09%09 %7B%0A%09%09   return ActionSupport.INPUT;%0A%09%09 %7D%0A%09%09 return actionInvocation.invoke(); %0A%09%7D%0A%0A%7D%0A

Create AuthenticationInterceptor.java