我在我的 struts.xml 中声明了以下操作:
<action path="/updateAccountInfo"
type="org.myCompany.UpdateAccountAction"
name="myAccountForm"
scope="session"
validate="true"
parameter="method"
input="/updateAccountInfo.jsp">
<forward name="success" path="/updateAccountInfo.jsp" />
</action>
在我的 JSP 页面中,我有以下形式:
<html:form action="/updateAccountInfo.do">
<input type="hidden" name="method" value="sendMessage" />
在我的 java 类中,我有以下方法:
public final ActionForward sendMessage(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, final HttpServletResponse response) throws Exception {
System.out.println("sending");
return null;
}
Struts 调用execute 方法而不是运行sendMessage。为什么?我的struts-config错了吗?还是我错过了另一个配置设置?