📄 addcustomeraction.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.wondersgroup.test.web.action;
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;
import org.apache.struts.actions.DispatchAction;
import com.wondersgroup.core.BaseAction;
import com.wondersgroup.test.bo.Customer;
import com.wondersgroup.test.service.CustomerService;
import com.wondersgroup.test.webform.AddCustomerForm;
/**
* MyEclipse Struts
* Creation date: 05-09-2007
*
* XDoclet definition:
* @struts.action path="/addCustomer" name="addCustomerForm" scope="request" validate="true"
*/
public class AddCustomerAction extends BaseAction {
CustomerService service=null;
public void setService(CustomerService service) {
this.service = service;
}
/*
* Generated Methods
*/
/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
AddCustomerForm addCustomerForm = (AddCustomerForm) form;// 1TODO Auto-generated method stub
Customer customer=new Customer();
customer.setName(addCustomerForm.getName());
//service = (CustomerService)this.getService("customerService", request);
System.out.println("ok");
service.saveCustomer(customer);
return null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -