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

📄 toupdatediseasehistory.java

📁 是一个J2EE的项目,在eclipse下编译通过,应用struts,hibernate开源框架,界面不是很漂亮.
💻 JAVA
字号:
package com.bjjd.web;
import java.util.ArrayList;
import java.util.Iterator;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.bjjd.datamodel.Diseasehistory;


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 com.bjjd.DAO.DiseasehistoryDAO;

/*
 * 
 * 获取要修改的记录动作
 */
public class Toupdatediseasehistory {
	public ActionForward execute(ActionMapping mapping, ActionForm form,
		    HttpServletRequest request, HttpServletResponse response) throws Exception {
		
		
		try
	    {
	    	boolean b=false;
	    	//获取id
	    	String strid=request.getParameter("diseasehid");
	    	//获取要修改的记录
	    	HttpSession httpsession=request.getSession();
	    	ArrayList l=(ArrayList)httpsession.getAttribute("diseasehlist");
	    	Iterator i=l.iterator();
	    	while(i.hasNext()&&(b==false))
	    	{
	    		Diseasehistory m=(Diseasehistory)i.next();
	    		String str=String.valueOf(m.getId());
	    		if(str.equals(strid))
	    		{
	    			//保存要修改的记录
	    			httpsession.setAttribute("diseaseh",m);
	    			b=true;
	    		}
	    		
	    	}
	    	
	    }
	    catch(Exception e)
	    {
	    	request.setAttribute("error", e.toString()+"aaaa");
	    	return (mapping.findForward("failed"));
	    }
		return mapping.findForward("success");
	}
}

⌨️ 快捷键说明

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