首页>代码>ssh实现的投票管理系统>/ssh实现的投票管理系统/23/src/sunyang/vote/action/interceptors/SessionInterceptor.java
package sunyang.vote.action.interceptors;

import java.util.Map;

import sunyang.vote.domain.Admin;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

@SuppressWarnings("serial")
public class SessionInterceptor extends AbstractInterceptor {
	private static final Object LOGIN_KEY = "admin";
	public static final String LOGIN_PAGE = "loginPage";

	@Override
	public String intercept(ActionInvocation actionInvocation) throws Exception {
		Map session = actionInvocation.getInvocationContext().getSession();
		Admin admin = (Admin) session.get(LOGIN_KEY);
		if (admin != null) {
			return actionInvocation.invoke();
		} else {
			return LOGIN_PAGE;
		}
	}
}
最近下载更多
青梧inn  LV3 2022年4月4日
xfcghjk  LV1 2022年3月15日
zhaimaliu  LV1 2021年12月31日
漫长的白日梦  LV8 2021年12月8日
liuyanmei  LV3 2021年5月19日
zzz115  LV1 2021年3月23日
kong.yee  LV40 2020年8月29日
DreamYoYo  LV2 2020年8月7日
zhaoxiangli  LV2 2020年7月7日
yuchen0623  LV1 2020年6月24日
最近浏览更多
qibodong  LV14 4月17日
wananall  LV13 3月13日
fffffffanan  LV1 3月1日
laishaofe  LV7 1月16日
Magic丶M  LV6 2023年12月29日
pangzhihui  LV12 2023年11月16日
阿卜杜萨拉木 2023年11月7日
暂无贡献等级
fesfefe  LV13 2023年11月6日
政政123456  LV3 2023年10月22日
27866849  LV4 2023年9月21日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友