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

📄 simplecondition.java

📁 一个简单的java邮件系统源码
💻 JAVA
字号:
package com.easyjweb.action;

import java.util.Iterator;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.easyjf.web.IPathMappingRuler;
import com.easyjf.web.core.PathMappingRulerImpl;
import com.easyjf.web.interceptor.security.ICondition;
import com.easyjf.web.interceptor.security.SecurityException;

public class SimpleCondition implements ICondition {

	public boolean doCheck(HttpServletRequest request,
			HttpServletResponse response) throws SecurityException {
		// TODO Auto-generated method stub
		IPathMappingRuler ruler=new PathMappingRulerImpl(request);
		Map param=ruler.getParams();
		if(param!=null){
			for(Iterator it=param.keySet().iterator();it.hasNext();){
				String parma=(String)it.next();
				if(parma.equalsIgnoreCase("name")){
					if(((String)param.get(parma)).equalsIgnoreCase("easyjf")){
						return true;
					}
				}
			}
		}
		throw new SecurityException("vaild user");
	}

	public String getName() {
		// TODO Auto-generated method stub
		return "simple";
	}

} 

⌨️ 快捷键说明

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