Thanks.

Do you know how can I change below message:
Invalid field value for field "amount" ?!


 
~Regards,
~~Alireza Fattahi


________________________________
 From: Dave Newton <davelnew...@gmail.com>
To: Struts Users Mailing List <user@struts.apache.org> 
Sent: Saturday, 13 July 2013, 16:16
Subject: Re: Int Validator
 

The field value error comes from the type conversion process. The field
should be an int or an Integer, with the caveat that an int has a default
value of 0, which may not be desirable.

Save
On Jul 12, 2013 11:56 PM, "Alireza Fattahi" <afatt...@yahoo.com> wrote:

> Hi,
>
> I want to validate the amount filed to be an integer with minimum value of
> 1
> I describe the field type as Integer (not int )
> Add below validation rule
>     <field name="amount">
>         <field-validator type="required" >
>             <message> ${getText("validate.required")}</message>
>         </field-validator>
>         <field-validator type="int">
>             <param name="min">10</param>
>             <message> ${getText("validate.int.min")}</message>
>         </field-validator>
>
>
> When the amount is empty I get validate.required error.
>
> When I type a text instead of integer I get  Invalid field value for field
> "amount" . I don't know where it comes from and how can I change it.
>
> Also please let me know if I should define the amount as int, Integer or
> String !
>
>
> ~Regards,
> ~~Alireza Fattahi

Reply via email to