.#addorderaction.java.1.1

来自「为交课程设计」· 1 代码 · 共 40 行

1
40
字号
package com.infodeliver.hr.order.action;

import com.infodeliver.hr.order.*;
import org.apache.struts.action.*;
import javax.servlet.http.*;
import com.infodeliver.hr.order.form.OrderActionForm;
import com.infodeliver.hr.order.dao.OrderManagerImpl;
import com.infodeliver.hr.factory.AbstractFactory;
 import org.apache.struts.util.LabelValueBean;
/**
 * <p>Todo </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2005</p>
 * <p>Company: infodeliver</p>
 * @author caojinli
 * @version 1.0
 */

public class AddOrderAction extends Action
{

  public ActionForward execute(ActionMapping mapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
    {
        /**@todo: complete the business logic here, this is just a skeleton.*/
        OrderActionForm orderActionForm = (OrderActionForm) actionForm;
        OrderManager ordermanager =  AbstractFactory.getInstance().getOrderManager();
        System.out.println("Add Order Action is called");
        try{
          if (ordermanager.newOrder(orderActionForm)) {
            return mapping.findForward("neworderok");
          }
        }catch(Exception e){
          System.err.println(e.getMessage());
          System.err.println(e.getCause());
        }
     return mapping.findForward("neworderfailure.jsp");

    }
}

⌨️ 快捷键说明

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