You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by boraldo <bo...@hotbox.ru> on 2009/03/15 18:55:02 UTC

validation: how to make int and double validations work ?

Say I want to validate field number.

This is a snippet from MyAction-validation.xml

    <field name="number">
        <field-validator type="int">
            <message>qwe</message>
        </field-validator>
    </field>

There are 2 cases.
1) If number is field of class String then this validation doesn't work at
all
2) If number is field of type int then this validation doesn't work also,
but besides if I enter not a number then the following exception is thrown:

              java.lang.NoSuchMethodException:
setNumber([Ljava.lang.String;)

and instead of my text I see at the page:

              Invalid field value for field "number"

So, in both cases int validation doesn't work. The same for double
validator.
What to do ?
-- 
View this message in context: http://www.nabble.com/validation%3A-how-to-make-int-and-double-validations-work---tp22525946p22525946.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org