⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bulletioninterceptor.java

📁 有简单的网上书店需求及设计流程
💻 JAVA
字号:
package org.wiely.interceptor;

import java.util.Map;

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

/**
 * Bulletion extends AbstractInterceptor
 * when update the bulletion ,you must be administrator,if
 * you aren'nt administrator,the page redirect the administrator slogin.jsp.
 */
@SuppressWarnings("serial")
public class BulletionInterceptor extends AbstractInterceptor {

	@SuppressWarnings("unchecked")
	@Override
	public String intercept(ActionInvocation invocation) throws Exception {
		Map session = ActionContext.getContext().getSession();

		if (session.get("admin") == null) {
			return "adminlogin";
		} else {
			return invocation.invoke();
		}

	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -