[ 
https://issues.apache.org/jira/browse/WW-4837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16119413#comment-16119413
 ] 

Lukasz Lenart commented on WW-4837:
-----------------------------------

I will add this to the migration guide as well. But instead adding quotes to 
all your literals at once you can implement a {{BigDecimal}} converter and 
register it in {{xwork-conversion.properties}} as stated here [1]. This will 
allow you migrate your code step by step. Another option is to use a custom 
{{StringConverter}} but then this can affect some other things as well, so I 
wouldn't go this way ;-)

{code}
# syntax: <type> = <converterClassName>
java.math.BigDecimal = com.acme.MyBigDecimalConverter
{code}

[1] 
https://struts.apache.org/docs/type-conversion.html#TypeConversion-ApplyingaTypeConverterforanapplication

> StringConverter adds a decimal place to integers
> ------------------------------------------------
>
>                 Key: WW-4837
>                 URL: https://issues.apache.org/jira/browse/WW-4837
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.5.12
>            Reporter: Mitth'raw'nuruodo
>             Fix For: 2.5.13
>
>         Attachments: 2017-08-08_1045.png
>
>
> Commit 229afea64e77c2dba9eec62b2c339e9fc92c9ec7 caused all inputs 
> recognisable as numbers to be formatted with at least one decimal place. This 
> includes all integers, which is frequently undesirable, particularly if they 
> were meant to be, eg:
> - identifiers, not for arithmetic;
> - strictly validated against an XML schema that does not allow for 
> floating-point numbers;
> - subject to length limitations;
> - etc
> This apparently occurs because all inputs that look like numbers, regardless 
> of format, are of type {{BigDecimal}} by the time they reach the 
> {{StringConverter}}.
> For our applications, this is a blocker; is it working differently for 
> others? We don't have any special handling of input types.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to