FileDocCategorySizeDatePackage
ChatAuthenticationInterceptor.javaAPI DocApache Struts 2.0.9 Apps2074Mon Jul 23 13:43:26 BST 2007org.apache.struts2.showcase.chat

ChatAuthenticationInterceptor

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

Fields Summary
private static final long
serialVersionUID
private static final Log
_log
public static final String
USER_SESSION_KEY
Constructors Summary
Methods Summary
public voiddestroy()


       
    
public voidinit()

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


        _log.debug("Authenticating chat user");

        SessionMap session = (SessionMap) ActionContext.getContext().get(ActionContext.SESSION);
        User user = (User) session.get(USER_SESSION_KEY);

        if (user == null) {
            return Action.LOGIN;
        }
        return invocation.invoke();