?? editchargeaction.java
字號(hào):
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package struts.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.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import business.IAdminOperator;
import po.Tcharge;
import struts.form.EditChargeForm;
/**
* 功能:設(shè)置收費(fèi)項(xiàng)目
* 作者:趙昌峻
* Creation date: 11-02-2006
*
* XDoclet definition:
* @struts.action path="/editCharge" name="editChargeForm" input="/web/Charge.jsp" scope="request" validate="true"
* @struts.action-forward name="success" path="/web/saveInfo.jsp" redirect="true"
*/
public class EditChargeAction extends Action {
/*
* 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) {
EditChargeForm editChargeForm = (EditChargeForm) form;// TODO Auto-generated method stub
Tcharge charge=new Tcharge();
charge.setCharge(Double.valueOf(editChargeForm.getCharge()));
charge.setChargeCode(editChargeForm.getChargeCode());
// 在AddCustomerAction里有相關(guān)注釋
ApplicationContext context=new FileSystemXmlApplicationContext("C:\\eclipse\\workspace\\chinamobile\\src\\applicationContext.xml");
IAdminOperator admin=(IAdminOperator)context.getBean("adminservice");
//System.out.println("hello!");
//調(diào)用業(yè)務(wù)層方法設(shè)置收費(fèi)細(xì)項(xiàng)
String message=admin.setMoney(charge);
System.out.println(message);
if(!message.equals("")){
request.setAttribute("message", message);
return mapping.findForward("success");
}
else{
return mapping.getInputForward();
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -