loginaction.java~39~

来自「郭克华j2ee高级框架实战教学视频源代码 这个是比较值得一看的 由郭克华博士」· JAVA~39~ 代码 · 共 39 行

JAVA~39~
39
字号
package prj37_1;

import org.apache.struts.action.*;
import javax.servlet.http.*;
import factory.*;
import javax.rmi.PortableRemoteObject;


public class LoginAction extends Action {
  public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) {
    /**@todo: complete the business logic here, this is just a skeleton.*/
    LoginForm loginForm = (LoginForm) actionForm;
    String account = loginForm.getAccount();
    String password = loginForm.getPassword();
    try {
      Object obj = EjbFactory.getEjbHome("CustomerBo");
      CustomerBoHome home = (CustomerBoHome) PortableRemoteObject.narrow(obj,
          CustomerBoHome.class);
      CustomerBo cbo = home.create();
      CustomerDto cus = cbo.login(account,password);
      if(cus!=null){
        request.getSession().setAttribute("cus",cus);
        return new ActionForward("");
      }


    }
    catch (Exception ex) {

    }






  }
}

⌨️ 快捷键说明

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