JSP:
<%@ page pageEncoding="GBK"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<html>
<head>
<title>多提交演示</title>
</head>
<body>
<html:form action="subscription">
<html:submit property="save" value="保存"/>
<html:submit property="back" value="后退"/>
<html:submit property="recalc" value="重新计算"/>
</html:form>
</body>
</html>
在Action中要有相应的方法:
public class SubscriptionAction extends LookupDispatchAction {
public ActionForward save(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {}
public ActionForward back(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {}
public ActionForward recalculate(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {}
}
MappingDispatchAction
public class MappingDispatchAction extends DispatchAction
它的相应方法的执行由ActionMapping中parameter名决定,注意这里和LookupDispatchAction不同,LookupDispatchAction的相应方法的执行由ActionMapping中parameter属性决定