I sort of already sent this message to the list but I made a mistake (didn't proof read my message) so here it is again but corrected ...
Validator "required" validation is NOT working for my String[] (in a dynaform. I have seen others on the list say it works for them. Anyone else experiencing the same problem? Possibly it is because I am using a multi-select? Basically, if nothing is selected then instead of null be sent back for that parameter I am getting a zero length String[]and it's toString() value is "[Ljava.lang.String;@3cfaab" which is important because of the way the validateRequired() method works... I looked at the source code (of my commons-validator.jar using jad). Maybe I am using an older version of the commons-validator jar and this was fixed or I am doing something else wrong? If so, where is the latest commons-validator.jar? Here is how my field is declared on the JSP: <html:select property="roles" multiple="true" size="7"> <html:options collection="<%=my.Const.ROLE_TYPES%>" property="roleName"/> </html:select> Here is how it is declared in the struts config: <form-property name="roles" type="java.lang.String[]"/> ---------------------------------------------------------------------------- Struts source Code: public static boolean validateRequired(Object bean, ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest request) { String value = null; if (isString(bean)) { value = (String) bean; } else { value = ValidatorUtil.getValueAsString(bean, field.getProperty()); } if (GenericValidator.isBlankOrNull(value)) { errors.add(field.getKey(), Resources.getActionError(request, va, field)); return false; } else { return true; } } Problem: ValidatorUtil.getValueAsString(bean, field.getProperty()) does a toString() on the value and a toString() on a String[] which isn't null it is some String like "[Ljava.lang.String;@3cfaab" and so then isBlankOrNull() is checking for null OR value.trim().length==0 and so neither is true and so validation passes. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]