Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-3218

Numeric field validators are not localized

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.3.10
    • Fix Version/s: 1.3.12
    • Component/s: Core
    • Labels:
      None

      Description

      See recent users' list discussion: http://markmail.org/thread/3sh5cqncwvpph3vr

      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").

        Attachments

        1. STR-3218.diff
          15 kB
          Christopher Schultz

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              chris@christopherschultz.net Christopher Schultz
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: