?? adminaction.java
字號:
package com.cargo.crotrol;import org.apache.struts.action.*;import javax.servlet.http.*;import com.cargo.model.Admin;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: MR</p> * @author BWM * @version 1.0 */public class AdminAction extends Action { public ActionForward perform(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { /**@todo: complete the business logic here, this is just a skeleton.*/ ActionErrors errors=new ActionErrors(); AdminForm adminForm = (AdminForm) actionForm; Admin admin= adminForm.getAdmin(); String id=this.getServlet().getServletConfig().getInitParameter("id"); String password=this.getServlet().getServletConfig().getInitParameter("password"); if(!admin.getId().equals(id.trim())||!admin.getPassword().equals(password.trim())){ errors.add(ActionErrors.GLOBAL_ERROR,new ActionError("error.logon.fail")); saveErrors(httpServletRequest,errors); } if(!errors.empty()){ return (new ActionForward(actionMapping.getInput())); } HttpSession session=httpServletRequest.getSession(); session.setAttribute("id",admin.getId()); return actionMapping.findForward("success"); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -