UserCheck.java
上传用户:quasar007
上传日期:2022-08-11
资源大小:4067k
文件大小:1k
源码类别:

企业管理

开发平台:

Java

  1. package com.webtier.manager;
  2. import org.apache.struts.action.ActionMapping;
  3. import org.apache.struts.action.ActionForm;
  4. import javax.servlet.http.HttpServletRequest;
  5. import javax.servlet.http.HttpServletResponse;
  6. import org.apache.struts.action.ActionForward;
  7. import com.domain.UserForm;
  8. import org.apache.struts.action.Action;
  9. import com.service.UserFacade;
  10. import com.service.UserFacadeImpl;
  11. import com.tool.Chinese;
  12. //操作员登陆
  13. public class UserCheck
  14.     extends Action {
  15.   private UserFacade facade = null;
  16.   public UserCheck() {
  17.     this.facade = new UserFacadeImpl();
  18.   }
  19.   public ActionForward perform(ActionMapping actionMapping,
  20.                                ActionForm actionForm,
  21.                                HttpServletRequest servletRequest,
  22.                                HttpServletResponse servletResponse) {
  23.     UserForm userForm = (UserForm) actionForm;
  24.     userForm.setUser_name(Chinese.str(servletRequest.getParameter("name")));
  25.     UserForm form = this.facade.checkUser(userForm);
  26.     String mm = Chinese.str(servletRequest.getParameter("mm"));
  27.     if (form == null) {
  28.       return actionMapping.findForward("checkFail");
  29.     }
  30.     else if (!form.getUser_mm().equals(mm)) {
  31.       return actionMapping.findForward("checkFail");
  32.     }
  33.     servletRequest.setAttribute("form", form);
  34.     return actionMapping.findForward("checkSuccess");
  35.   }
  36. }