Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4581

BigDecimal are not converted according context locale

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.20
    • Fix Version/s: 2.5.12
    • Component/s: None
    • Labels:
      None
    • Environment:

      Glassfish 4.0, Java 7

      Description

      Calling an action, it's impossible to assign a value like "123,45" to all properties which type is java.math.BigDecimal, even if context locale decimal separator is comma.
      Same string converted in a java.lang.Double works.

        Issue Links

          Activity

          Hide
          lukaszlenart Lukasz Lenart added a comment -

          You can always use your own converter:

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

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

          Show
          lukaszlenart Lukasz Lenart added a comment - You can always use your own converter: # syntax: <type> = <converterClassName> java.math.BigDecimal = com.acme.MyBigDecimalConverter https://struts.apache.org/docs/type-conversion.html#TypeConversion-ApplyingaTypeConverterforanapplication
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit f874f9cde56f74c5161b17e645f779805c51a04b in struts's branch refs/heads/master from Lukasz Lenart
          [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=f874f9c ]

          WW-4581 Uses proper logic to convert String to BigDecimal

          Show
          jira-bot ASF subversion and git services added a comment - Commit f874f9cde56f74c5161b17e645f779805c51a04b in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=f874f9c ] WW-4581 Uses proper logic to convert String to BigDecimal
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 2fb431d97e479881cace53d4dc387a961b52f575 in struts's branch refs/heads/master from Lukasz Lenart
          [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=2fb431d ]

          WW-3171 WW-3650 WW-4581 makes number converters locale aware

          Show
          jira-bot ASF subversion and git services added a comment - Commit 2fb431d97e479881cace53d4dc387a961b52f575 in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=2fb431d ] WW-3171 WW-3650 WW-4581 makes number converters locale aware
          Hide
          lukaszlenart Lukasz Lenart added a comment -

          PR got merged

          Show
          lukaszlenart Lukasz Lenart added a comment - PR got merged
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build Struts-JDK7-master #633 (See https://builds.apache.org/job/Struts-JDK7-master/633/)
          WW-4581 Uses proper logic to convert String to BigDecimal (lukaszlenart: rev f874f9cde56f74c5161b17e645f779805c51a04b)

          • (edit) core/src/main/java/com/opensymphony/xwork2/conversion/impl/NumberConverter.java
          • (edit) core/src/test/java/com/opensymphony/xwork2/conversion/impl/NumberConverterTest.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Struts-JDK7-master #633 (See https://builds.apache.org/job/Struts-JDK7-master/633/ ) WW-4581 Uses proper logic to convert String to BigDecimal (lukaszlenart: rev f874f9cde56f74c5161b17e645f779805c51a04b) (edit) core/src/main/java/com/opensymphony/xwork2/conversion/impl/NumberConverter.java (edit) core/src/test/java/com/opensymphony/xwork2/conversion/impl/NumberConverterTest.java

            People

            • Assignee:
              Unassigned
              Reporter:
              arturo Arturo Imposimato
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development