You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rahul Joshi <ra...@globallogic.com> on 2007/07/18 06:01:44 UTC

Validation of DynaValidatorForm with String array

Hi,

In my struts application I am using a DynaValidatorForm which contains a
String[].
I am doing "required", "integer" and "intRange" validation on the form.
The problem I am facing is that if I declare the property in
struts-config.xml as a string array with given size 
(like this : <form-property name="propName" type="java.util.String[]"
size="264"/>)
then the "required" validation fails, on every form submit which has
less then 264 instances of propName.

For example if form is submitted with only propName[0]=5 &
propName[1]=10 then validation fails for rest of the array.


How can I get the form validatation for only limited size of array, in
this case for only two indexes.

Any suggestion is appreciated.

Thanks
-Rahul