package com.action; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForm; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForward; import com.dao.LibraryDAO; import com.actionForm.LibraryForm; import org.apache.struts.action.Action; public class Library extends Action { LibraryDAO libraryDAO=null; public Library(){ libraryDAO=new LibraryDAO(); } public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { LibraryForm libraryForm=(LibraryForm) form; String str=request.getParameter("action"); if("libraryQuery".equals(str)){ return libraryModifyQuery(mapping,form,request,response); }else if("libraryModify".equals(str)){ return libraryModify(mapping,form,request,response); } request.setAttribute("error","��IJ�������"); return mapping.findForward("error"); } private ActionForward libraryModify(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response ){ LibraryForm libraryForm = (LibraryForm) form; libraryForm.setId(libraryForm.getId()); libraryForm.setLibraryname(libraryForm.getLibraryname()); libraryForm.setCurator(libraryForm.getCurator()); libraryForm.setTel(libraryForm.getTel()); libraryForm.setAddress(libraryForm.getAddress()); libraryForm.setEmail(libraryForm.getEmail()); libraryForm.setUrl(libraryForm.getUrl()); libraryForm.setCreateDate(libraryForm.getCreateDate()); libraryForm.setIntroduce(libraryForm.getIntroduce()); int ret = libraryDAO.update(libraryForm); if (ret ==0) { request.setAttribute("error", "ͼ�����Ϣ��ʧ�ܣ�"); return mapping.findForward("error"); } else { return mapping.findForward("librarymodify"); } } private ActionForward libraryModifyQuery(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response ){ request.setAttribute("libraryModifyif",libraryDAO.query()); return mapping.findForward("librarymodifyQuery"); } }

破壳鸡蛋 LV6
9月1日
卑微大学生在线学java LV1
2024年6月30日
柳咪华沙 LV7
2024年6月28日
RAINK_L LV3
2023年12月12日
hfkdny LV2
2023年6月6日
dmyafda LV5
2023年3月26日
想飞的大肥猪 LV9
2023年3月10日
微信网友_5925912300212224 LV1
2023年1月29日
微信网友_6254095067451392 LV3
2022年12月9日
askjhfasf LV1
2022年11月5日

微信网友_7695417429544960
9月22日
暂无贡献等级
13752890376
9月22日
暂无贡献等级
haixiao
9月16日
暂无贡献等级
破壳鸡蛋 LV6
9月1日
落花清阳
6月6日
暂无贡献等级
895969
5月14日
暂无贡献等级
代码搬运工646
2月17日
暂无贡献等级
暂无贡献等级
66202943
1月4日
暂无贡献等级
qwehanL
2024年12月22日
暂无贡献等级