struts动态表单验证问题
我在验证时\用了struts的validation.xml这个文件\里面是这样写的:
<form name= "villanetForm ">
<field property= "cccc " depends= "required,maxlength,mask ">
<arg0 key= "housenetForm.ccc " />
<arg1 name= "maxlength " key= "${var:maxlength} " resource= "false "/>
<arg2 name= "mask " key= "housenetForm.Integer "/>
<var>
<var-name> maxlength </var-name>
<var-value> 10 </var-value>
</var>
<var>
<var-name> mask </var-name>
<var-value> ^\d*$ </var-value>
</var>
</field>
</form>
然后的我的资源文件中错误是这样写的
housenetForm.ccc=....
housenetForm.Integer=....
上面的错误可以显示出来
可是判断长度的那个错误为什么显示不出来
errors.maxlength=...
我有的form中有几个字段都要判断长度\且长度不一样\但是我发现errors.maxlength这里只能给个定长\我应该怎么做?
------解决方案--------------------maxlength有定义吗?
------解决方案-------------------- <form name= "villanetForm ">
<field property= "cccc " depends= "required,maxlength,mask ">
<arg0 key= "housenetForm.ccc " />
<arg1 key= "${var:maxlength} " resource= "false "/>
<arg2 name= "mask " key= "housenetForm.Integer "/>
<var>
<var-name> maxlength </var-name>
<var-value> 10 </var-value>
</var>
<var>
<var-name> mask </var-name>
<var-value> ^\d*$ </var-value>
</var>
</field>
</form>
你试下这个看看