Package com.chandana.dev.action

Source Code of com.chandana.dev.action.AddCustomerAction

package com.chandana.dev.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.springframework.web.struts.ActionSupport;

import com.chandana.dev.domain.Customer;
import com.chandana.dev.form.CustomerForm;
import com.chandana.dev.manager.CustomerManager;

/**
*
* @author Chandana Napagoda
*
*/

public class AddCustomerAction extends ActionSupport {

  public ActionForward execute(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws Exception {   
    CustomerManager customerBo = (CustomerManager) getWebApplicationContext()  .getBean("customerBo");
    CustomerForm customerForm = (CustomerForm) form;
    Customer customer = new Customer();
    BeanUtils.copyProperties(customer, customerForm);
    customerBo.addCustomer(customer);
    return mapping.findForward("success");

  }

}
TOP

Related Classes of com.chandana.dev.action.AddCustomerAction

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.