struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Schultz (JIRA)" <>
Subject [jira] [Updated] (STR-3218) Numeric field validators are not localized
Date Sun, 20 Jan 2013 15:56:12 GMT


Christopher Schultz updated STR-3218:

    Attachment: STR-3218.diff

Patch for FieldsChecks to add validate[Type]RangeLocale methods. This should not interfere
with any existing code as the methods are new: users can choose to use them if they desire
locale-aware numeric-range-checking, or they can use the existing non-locale-aware range-checking
methods to improve performance somewhat.
> Numeric field validators are not localized
> ------------------------------------------
>                 Key: STR-3218
>                 URL:
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.3.10
>            Reporter: Christopher Schultz
>         Attachments: STR-3218.diff
> See recent users' list discussion:
> The following o.a.s.validator.FieldChecks methods do not use the user's Locale when calling
commons-validator's available methods for parsing floating-point values:
> validateDouble
> validateDoubleRange
> validateFloat
> validateFloatRange
> validateInteger
> validateIntegerRange
> validateLong
> validateLongRange
> validateShort
> validateShortRange
> For the integral data types, this isn't such a bug deal because thousands separators
are optional (like "1,000" in en-US locale for "one thousand). However, for decimal types,
the decimal separator is required and when my default locale is en-US I cannot successfully
validate a decimal formatted for, say, Spanish locale (e.g. "1,50" for "one and a half").

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

View raw message