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","您的操作有误!"); 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"); } }
最近下载更多
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日
ARTICLE LV3
2022年10月28日
微信网友_6124119773040640 LV1
2022年9月8日
caiji888 LV1
2022年7月10日
最近浏览更多
白云分局应该好好
3月15日
暂无贡献等级
XCxuebc
3月12日
暂无贡献等级
微信网友_6904205432819712 LV1
3月12日
jianxinbing007
3月7日
暂无贡献等级
iioopjkl
2月26日
暂无贡献等级
离开吗
2月19日
暂无贡献等级
暂无贡献等级
实话大王
1月17日
暂无贡献等级
pingle
1月15日
暂无贡献等级
zsh040214
1月4日
暂无贡献等级