📄 updateallergyhistory.java
字号:
package com.bjjd.web;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.bjjd.datamodel.Allergyhistory;
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.AllergyhistoryDAO;
/*
* 修改过敏史记录动作
*
*/
public class Updateallergyhistory extends Action{
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception {
try
{
//设置要更新的实体类
Allergyhistory ah=new Allergyhistory();
ah=(Allergyhistory)request.getSession().getAttribute("ah");
ah.setName(request.getParameter("name"));
ah.setSex(request.getParameter("sex"));
ah.setType(request.getParameter("type"));
ah.setDescription(request.getParameter("description"));
//更新记录
AllergyhistoryDAO m=new AllergyhistoryDAO();
m.updateallergyhistory(ah);
//保存信息
request.setAttribute("asd", "success");
}
catch(Exception e)
{
request.setAttribute("error", e.toString()+"bbbb");
return (mapping.findForward("failed"));
}
return (mapping.findForward("success"));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -