I'm trying to validate a range using the validator. I've got this in 
validation.xml...

<form-validation>
    <formset>
        <form name='loginForm'>
            <field property='number' depends='range'>
                <arg0 key='login.number.displayName'/>
                <arg1 name='min' key='${var:min}' resource='false'/>
                <arg2 name='max' key='${var:max}' resource='false'/>
                <var>
                    <var-name>min</var-name>
                    <var-value>5</var-value>
                </var>
                <var>
                    <var-name>max</var-name>
                    <var-value>10</var-value>
                </var>
            </field>
        </form>
    </formset>
</form-validation>

...and this is how the field is defined in the form:

<html:form action='login.do' focus='name'>
    <table>
        <tr>
            <td><fmt:message key='login.number.displayName'/><td>
            <td><html:text property='number'/></td>
        </tr>
    </table>
</html:form>

The validation works: If I enter a value outside of the range, I get an 
error, and if not, I don't. But it's the error message that's the problem:

Number is not in the range null through null.

For some reason, even though the validator uses the correct min and max 
for validation, the error message doesn't reflect that. I've got the 
field display name and error message defined in my resource bundle, like 
this:

login.number.displayName=Number
errors.range={0} is not in the range {1} through {2}.

Does anyone know what's wrong?

Thanks,


david

Reply via email to