FileDocCategorySizeDatePackage
AuthenticationInterceptor.javaAPI DocApache Struts 2.0.9 Apps862Mon Jul 23 13:43:12 BST 2007mailreader2

AuthenticationInterceptor

public class AuthenticationInterceptor extends Object implements com.opensymphony.xwork2.interceptor.Interceptor

Fields Summary
Constructors Summary
Methods Summary
public voiddestroy()

public voidinit()

public java.lang.Stringintercept(com.opensymphony.xwork2.ActionInvocation actionInvocation)


        Map session = actionInvocation.getInvocationContext().getSession();

        User user = (User) session.get(Constants.USER_KEY);

        boolean isAuthenticated = (null!=user) && (null!=user.getDatabase());

        if (!isAuthenticated) {
            return Action.LOGIN;            
        }
        else {
            return actionInvocation.invoke();
        }