當在stuts中需要在一個action中定義多個方法時
下面是測試的一個簡單的例子
Action:
//Created by MyEclipse Struts
// XSL source (default): platform:/plugin/
package
import javax
import javax
import org
import org
import org
import org
/**
* MyEclipse Struts
* Creation date:
*
* XDoclet definition:
* @struts
*/
public class MyDispathAction extends DispatchAction {
//
//
/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward Add(
ActionMapping mapping
ActionForm form
HttpServletRequest request
HttpServletResponse response) {
request
return mapping
}
public ActionForward Delete(
ActionMapping mapping
ActionForm form
HttpServletRequest request
HttpServletResponse response) {
request
return mapping
}
}
stuts
<action
parameter=
path=
type=
validate=
<forward name=
</action>
需要注意的是要將action中的execute方法刪除!!!
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28238.html