commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "tomster (JIRA)" <>
Subject [jira] Created: (VALIDATOR-189) Validating array integers fails
Date Tue, 30 May 2006 05:30:30 GMT
Validating array integers fails

         Key: VALIDATOR-189
     Project: Commons Validator
        Type: Bug

 Environment: Tomcat  5.5.17, Struts 1.2.9 (default validator 1.1.4 and 1.3.0)
    Reporter: tomster

I posted this issue on Struts and it got determined to be a validator bug (or appears to be).

There seems to be some issue with validating integer arrays: 


<html:select property="types" multiple="true" size="3" > 
<html:option value="1">should work</html:option> 
<html:option value="2">should work as well</html:option> 
<html:option value="blah">this will fail validation</html:option> 


public class PropertyFilter implements Serializable 
  private String[] types; 
    public String[] getTypes() { 
    return types; 
    public void setTypes(String[] types) { 
    this.types = types; 

<form name="PropertyFilterForm"> 
<field property="types" depends="integer"> 
<arg0 key="text.validation.type"/> 

Even if all values are integer, it will fail validation regardless. According to
I should 
do something like: 
<field property="types" indexedListProperty="types" depends="integer"> 
<arg0 key="text.validation.type"/> 
This time, it does indeed check all the values are of type integer, however, 
if you do not select anything (the field is not required) the result is: 

Also having scoured all documentation in current and future builds and there is no example
of validating an integer array. 

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message