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

ChatInterceptor

public class ChatInterceptor extends Object implements com.opensymphony.xwork2.interceptor.Interceptor
Authenticate showcase chat example, make sure everyone have a username.

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


       
    
public voidinit()

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

        HttpSession session = (HttpSession) ActionContext.getContext().get(ActionContext.SESSION);
        User chatUser = (User) session.getAttribute(CHAT_USER_SESSION_KEY);
        if (chatUser == null) {
            _log.debug("Chat user not logged in");
            return Action.LOGIN;
        }
        return invocation.invoke();