public String intercept(ActionInvocation invocation) throws Exception {
ActionContext ac = invocation.getInvocationContext();
Object action = invocation.getAction();
if (action instanceof LoginAction) {
return invocation.invoke();
}
HttpServletRequest request = (HttpServletRequest) ac.get (StrutsStatics.HTTP_REQUEST);
//HttpServletResponse response = (HttpServletResponse) ac.get(StrutsStatics.HTTP_RESPONSE);
HttpSession session = request.getSession();
User user = (User) session.getAttribute("user_login");
if (null == user) {
if(log.isDebugEnabled()) {
log.debug("redirect to login");
}
return Action.LOGIN;
}
ActionProxy proxy = invocation.getProxy();
ActionConfig config = proxy.getConfig();
log.info("[classname : "+config.getClassName() + "\tmethodname:" + config.getMethodName()+"]");
return invocation.invoke();
}