loginaction.java

来自「l劳动力管理系统」· Java 代码 · 共 46 行

JAVA
46
字号
package com.hr.action;import org.apache.struts.action.*;import javax.servlet.http.*;import com.hr.vo.*;import com.hr.logic.HrLogic;public class LoginAction extends Action {  public ActionForward perform(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {    /**@todo: complete the business logic here, this is just a skeleton.*/    String username = httpServletRequest.getParameter("username");      String password = httpServletRequest.getParameter("password");      System.out.println("username ==" + username);      System.out.println("password ==" + password);      HrLogic logic = new HrLogic();      User user = logic.passOrNot(username,password);      Employee employee = logic.getEmployee(user.getEmployeeUID());      logic.closeDAO();      if(user!=null)      {          HttpSession session = httpServletRequest.getSession(true);          session.setAttribute("pass",employee);          System.out.println("username====" +  user.getUserName());          if(user.getUserType().intValue()==1)          {              return actionMapping.findForward("useraction");          }          if(user.getUserType().intValue()==2)          {              return actionMapping.findForward("employee");          }          if(user.getUserType().intValue()==3)          {              return actionMapping.findForward("manager");          }      }          System.out.println("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa");          return actionMapping.findForward("login");  }  }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?