⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 editchargeruleaction.java

📁 中国移动的Hibernate+Spring+Struts项目 源码无私奉献~~
💻 JAVA
字号:
/*
 * 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 struts.form.EditChargeRuleForm;

/** 
 * 功能:设置业务收费
 * 作者:赵昌峻
 * Creation date: 11-02-2006
 * 
 * XDoclet definition:
 * @struts.action path="/editChargeRule" name="editChargeRuleForm" input="/web/Charge.jsp" scope="request" validate="true"
 * @struts.action-forward name="success" path="/web/saveInfo.jsp" redirect="true"
 */
public class EditChargeRuleAction 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) {
		EditChargeRuleForm editChargeRuleForm = (EditChargeRuleForm) form;// TODO Auto-generated method stub
		//得到页面传过来的收费细项,由于收费种类可能有多项,所以用数组
		String[] chargestr=request.getParameterValues("item");	
		//		在AddCustomerAction里有相关注释
		ApplicationContext context=new FileSystemXmlApplicationContext("C:\\eclipse\\workspace\\chinamobile\\src\\applicationContext.xml");
		IAdminOperator admin=(IAdminOperator)context.getBean("adminservice");
		System.out.println("hello!");
		//调用业务层的方法设置业务收费
		String message=admin.editChargeRule(editChargeRuleForm.getRule(), chargestr);
		System.out.println(message);
		if(!message.equals("")){
			request.setAttribute("message", message);
			return mapping.findForward("success");
		}
		else{
			return mapping.getInputForward();
		}
	}
}

⌨️ 快捷键说明

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