欢迎来到天天文库
浏览记录
ID:41674871
大小:78.25 KB
页数:40页
时间:2019-08-29
《高校订水系统(无jsp)》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、packagecom.action;importjavax.servlet.http.HttpServletRequest;importorg.apache.struts2.ServletActionContext;importcom.dao.AdminDAO;importcom.model.Admin;importcom.opensymphony.xwork2.ActionContext;importcom.opensymphony.xwork2.ActionSupport;publicclas
2、sAdminActionextendsActionSupport{publicStringadminLogin(){ActionContextcontext=ActionContext.getContext();HttpServletRequestrequest=ServletActionContext.getRequest();Stringname=request.getParameter(HnameH);Stringpassword=request.getParameter(npassword
3、n);System.out.print(name+nu+password);if(name==null
4、
5、password==null){returnHerror°;}else{Adminadmin二AdminDAO・checkAdmin(name,password);if(admin==null){returnMerrorn;}else{returnSUCCESS;packagecom.action;importjavax.servlet.http.HttpServletRequest;impo
6、rtorg.apache.struts2.ServletActionContext;importcom.dao.FirstPageDAO;importcom.model.Firstpage;importcom.opensymphony.xwork2.ActionContext;importcom.opensymphony.xwork2.ActionSupport;〃显示首页publicStringadminShowFirstPage(){ActionContextcontext=ActionCon
7、text.getContext();Firstpagefirstpage=FirstPageDAO.getFirstPage();context.put(Hfirstpage,firstpage);returnHfirstpagen;}//用户显示首页@OverridepublicStringexecute()throwsException{//TODOAuto-generatedmethodstubActionContextcontext=ActionContext.getContext();
8、Stringdescription=FirstPageDAO9、rstpage,firstpage);returnnmodifyfirstpage11;}〃保存修改信息publicStringsaveFirstpage(){ActionContextcontext=ActionContext.getContext();HttpServletRequestrequest=ServletActionContext.getRequest();Stringsid=request.getParameter(HidH);intid=Integer.parselnt(si10、d);Stringdescription=request.getParameter(ncontentM);Firstpagefirstpage=FirstPageDAO.getFirstPageById(id);firstpage.setDescription(description);FirstPageDAO.saveFirstPage(firstpage);context.put(Hfirstpage,firstpage);return”firstpage";packagec
9、rstpage,firstpage);returnnmodifyfirstpage11;}〃保存修改信息publicStringsaveFirstpage(){ActionContextcontext=ActionContext.getContext();HttpServletRequestrequest=ServletActionContext.getRequest();Stringsid=request.getParameter(HidH);intid=Integer.parselnt(si
10、d);Stringdescription=request.getParameter(ncontentM);Firstpagefirstpage=FirstPageDAO.getFirstPageById(id);firstpage.setDescription(description);FirstPageDAO.saveFirstPage(firstpage);context.put(Hfirstpage,firstpage);return”firstpage";packagec
此文档下载收益归作者所有