我有一種情況,我有2個方法在相同的操作類method1和method2。下面是我在struts.xml中的動作映射通配符方法Struts2驗證
< action name="actionName_*" class="sample.input.SubmitTest" method="{1}">
< interceptor-ref name="defaultStak" />
< result name="input">info.jsp< result ends>
< result name="success">info.jsp< result ends>
< result name="error">error.jsp< result ends>
< action ends>
驗證規則method1和method2是不同的,所以我有2個驗證xml文件。 1:actionName_method1-validation.xml中 2:actionName_method2-validation.xml中
我調用從JSP這些方法如以下所示,
< s:form action="actionName_" method="post">
<!-- here goes the fields to be submitted -->
<s:submit type="simple" method="method1" value="execute1"/>
<s:submit type="simple" method="method2" value="execute2"/>
< s:form end tag>
然而對於一些驗證沒有得到執行的原因。我在這裏錯過了什麼,任何人都可以請幫忙嗎?