baoxiaoaction.java
来自「Struts2一个应用示例。主要是加深对Struts2d的一个理解。希望对初学者」· Java 代码 · 共 57 行
JAVA
57 行
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.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 com.business.BusinessService;
import com.struts.form.BaoxiaoForm;
/**
* MyEclipse Struts
* Creation date: 03-15-2008
*
* XDoclet definition:
* @struts.action path="/baoxiao" name="baoxiaoForm" input="/mainpage.jsp" scope="request" validate="true"
*/
public class BaoxiaoAction extends Action {
/*
* Generated Methods
*/
private BusinessService busService;
public BusinessService getBusService() {
return busService;
}
public void setBusService(BusinessService busService) {
this.busService = busService;
}
/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
BaoxiaoForm baoxiaoForm = (BaoxiaoForm) form;// TODO Auto-generated method stub
boolean flag=busService.getBaoxiaoBus().save(baoxiaoForm);
if(flag)
{
return mapping.findForward("ok");
}
return mapping.findForward("error");
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?