DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25479>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25479

the validator framework does not take locale into account for validating floats

           Summary: the validator framework does not take locale into
                    account for validating floats
           Product: Struts
           Version: 1.1 Final
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Validator Framework
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


the validator framework does not take locale into account for validating floats

and it is normal: 


    /**
     * Checks if the value can safely be converted to a float primitive.
     *
     * @param value The value validation is being performed on.
     */
    public static Float formatFloat(String value) {
        if (value == null) {
            return null;
        }
        try {
            return new Float(value);
        } catch(NumberFormatException e) {
            return null;
        }
    }

this piece of code is a snippet from the Validator GenericTypeValidator class, 
which doesn't use the locale. --> when users use a different locale than the 
server default locale, it fails:

If I use a "fr" locale, and enters "2,6", it is not recognized as a float, and 
an exception is thrown.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to