I have a property in a Struts DynaValidatorActionForm that is an array of Integers:
<form-property name="ids" type="java.lang.Integer[]"/>
I'd like to perform a validation on each of these Integers. For example, let's say I want to validate that none of them is equal to the number 1:
<field property="ids" depends="validwhen" indexedListProperty="ids">
<arg0 key="label.ids"/>
<var>
<var-name>test</var-name>
<var-value>*this* != 1</var-value>
</var>
</field>
This produces the following stacktrace:
java.lang.NoSuchMethodException: Unknown property 'secondaryschoolids' at org.apache.commons.beanutils.PropertyUtils.getSimpleProperty(PropertyUtils.java:1175) at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:772) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801) at org.apache.commons.validator.util.ValidatorUtils.getValueAsString(ValidatorUtils.java:105) at org.apache.struts.validator.validwhen.ValidWhen.validateValidWhen(ValidWhen.java:97) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.commons.validator.ValidatorAction.executeValidationMethod(ValidatorAction.java:567) at org.apache.commons.validator.Field.validateForRule(Field.java:811) at org.apache.commons.validator.Field.validate(Field.java:890) at org.apache.commons.validator.Form.validate(Form.java:174) at org.apache.commons.validator.Validator.validate(Validator.java:367) at org.apache.struts.validator.DynaValidatorForm.validate(DynaValidatorForm.java:112) at org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:921) ...
Does anyone have any ideas on how to do this using the XML validation configs? I tried googling but there's not much out there. The 'property' attribute' is required for the 'field' element.