【Java开源代码栏目提醒】:网学会员--在 Java开源代码编辑为广大网友搜集整理了:AuthorizationInterceptor.java绩等信息,祝愿广大网友取得需要的信息,参考学习。
package struts2.interceptors;
import java.util.Map;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
public class AuthorizationInterceptor extends AbstractInterceptor {
@Override
public String intercept(ActionInvocation ai) throws Exception {
Map session = ai.getInvocationContext().getSession();
String user = (String) session.get( "user" );
if (user != null) {
return ai.invoke();
} else {
return Action.LOGIN;
}
}
}
上一篇:
AuthorityUtil.java
下一篇:
首鼠两端