Announcement Announcement Module
Collapse
No announcement yet.
possible bug in BeanValidator Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • possible bug in BeanValidator

    I am using the apache commons validator with spring MVC.

    <bean id="commonValidator" class="org.springframework.validation.commons.Bean Validator">
    <property name="validatorFactory"><ref local="validatorFactory"/></property>
    </bean>
    <bean id="validatorFactory" class="org.springframework.validation.commons.Vali datorFactory" init-method="init">
    <property name="resources">
    <list>
    <value>WEB-INF/validator-rules.xml</value>
    <value>WEB-INF/validation.xml</value>
    </list>
    </property>
    </bean>

    Here's my validation definition in validation.xml

    <field property="successRate" depends="floatRange">
    <msg name="floatRange" key="errors.floatRange" />
    <arg0 key="global.label.successRate"/>
    <arg1 name="floatRange" key="${var:min}" resource="false"/>
    <arg2 name="floatRange" key="${var:max}" resource="false"/>
    <var><var-name>min</var-name><var-value>0.0</var-value></var>
    <var><var-name>max</var-name><var-value>100.0</var-value></var>
    </field>

    even though I have set the value for the resource attribute to false. The error message in my page shows up as

    Success Rate is not in the range ???0.0??? through ???0.0???

    Which means it is doing a resource lookup when it shouldn't.

    Has anyone experienced the same problem?
Working...
X