[ 
https://issues.apache.org/struts/browse/WW-2349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42764
 ] 

Sebastian commented on WW-2349:
-------------------------------

Ok maybe I have found the cause of this issue. Some developer disabled the 
localization for Number to String conversion in 
com.opensymphony.xwork2.util.XWorkBasicConverter, line 76:

<snip>
        if (toType == String.class) {
            /* the code below has been disabled as it causes sideffects in 
Strtus2 (XW-512)
            // if input (value) is a number then use special conversion method 
(XW-490)
            Class inputType = value.getClass();
            if (Number.class.isAssignableFrom(inputType)) {
                result = doConvertFromNumberToString(context, value, inputType);
                if (result != null) {
                    return result;
                }
            }*/
            // okay use default string conversion
            result = doConvertToString(context, value);
</snip>

Well, it seems that disabling this code also has serious side effects, as it 
causes the mentioned problem when using a non-English locale.

> localized conversion from double to string broken
> -------------------------------------------------
>
>                 Key: WW-2349
>                 URL: https://issues.apache.org/struts/browse/WW-2349
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.0.11
>            Reporter: Sebastian
>
> Locale is set to de_DE.
> Action contains a property 
> private Double percentage;
> with getters/setters.  The corresponding page contains a "textfield" tag for 
> this property. It only accepts a "," (comma) as a decimal separator due to 
> the set locale. This is fine and ok.
> But when I preset the Double property to a certain value and render the page 
> afterwards, the textfield is filled with a number using the "." (dot) as 
> decimal separator, instead of comma. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to