在是用struts的validate框架中当使用validator-rule.xml时,当在同时验证了如maxlength和minlength的是后在复合消息的参数中都有{1}这样时。可以使用两个<arg1>来是复合参数显示正确的消息。
例如:
 1 <field property="phone" depends="required,mask,minlength,maxlength">
 2                 <arg0 key="phne" resource="false"/>
 3                 <arg1 name="minlength" key="${minlength}" resource="fasle"/>
 4                 <arg1 name="maxlength" key="${maxlength}" resource="fasle"/>
 5                 <var>
 6                     <var-name>mask</var-name>
 7                     <var-value>${phone}</var-value>
 8                 </var>
 9                 <var>
10                     <var-name>minlength</var-name>
11                     <var-value>8</var-value>
12                 </var>
13                 <var>
14                     <var-name>maxlength</var-name>
15                     <var-value>8</var-value>
16                 </var>
17             </field>