[阅读: 298] 2005-11-26 12:28:25
package CustomerService;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public class CustomerAction extends Action {
public ActionForward execute(ActionMapping mapping,
HttpServletRequest request, HttpServletResponse response,
ActionForm form) {
CustomerForm customerForm=(CustomerForm)form;
try {
CustomerBean bean = new CustomerBean();
Customer customer =new Customer();
customer =customerForm.getCustomer();
bean.createCustomer(customer);
} catch (Exception e) {
e.printStackTrace();
}
request.setAttribute("Customer",customerForm.getCustomer());
return (mapping.findForward("customerCreated"));
}
}