I have the same question. Below is my code:
================JSP CODE START===============
<html:form action="/setuser" >
<% for (int i = 0; i < LENGTH; i ++ ) { %>
<tr><td align="center"><html:text property='<%= "user[" + i + "]"%>' size="4" maxlength="4"/></td>
<% } %>
</html:form>
================JSP CODE END=================
================struts-config.xml start=========
<form-bean name="setuserForm" type="cn.justsystem.struts.form.SetuserForm">
<form-property size="9" name="users" type="java.lang.String[]" />
</form-bean>
================struts-config.xml end=========
I'm writing my validation.xml as below:
================validation.xml start===============
<form name="setuserForm">
<field property="users[0]" depends="short">
<msg name="short" key="errors.short"/>
</field>
</form>
================validation.xml end=================
But if i want to validate all of users property with save validation rules, i have to write the same part as above nine times.
Are there any good way to validate them?
Thanks!