updateaction.java

来自「xueyuan gongzuojieshao」· Java 代码 · 共 60 行

JAVA
60
字号
/*
 * 创建日期 2007-5-2
 *
 * TODO 要更改此生成的文件的模板,请转至
 * 窗口 - 首选项 - Java - 代码样式 - 代码模板
 */
package action.stipend;

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

import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import dao.login.stipendDao;

import form.stipend.stipendForm;

import bean.login.loginBean;
import bean.stipend.stipendBean;

/**
 * @author Administrator
 *
 * TODO 要更改此生成的类型注释的模板,请转至
 * 窗口 - 首选项 - Java - 代码样式 - 代码模板
 */
public final class updateAction extends Action{
	
	public ActionForward execute(ActionMapping mapping,
			                      ActionForm form,
								  HttpServletRequest request,
								  HttpServletResponse response
								  ) throws Exception{
		String forward = null;
		loginBean bean = (loginBean)request.getSession().getAttribute("bean");
		if(bean!=null){
			if(bean.getIsAdmin().equals("1")){
				stipendForm myform = (stipendForm)form;
				stipendBean be = new stipendBean();
				BeanUtils.copyProperties(be,myform);
				stipendDao dao = new stipendDao();
				be = dao.stipendSelectAll(be);
				request.setAttribute("be",be);
				forward ="OK";
			}else{
				forward ="Not";
			}
		}else{
			forward ="index";
		}
		return (mapping.findForward(forward));
		
	}

}

⌨️ 快捷键说明

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