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

Struts 2 and JDK 17 numbers of iterator tag when using different locale

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 6.3.0
    • 6.4.0
    • Core
    • None

    Description

      With struts `6.3.0.1` and jdk 8 in locale `fa_IR` the below generates `1, 2, 3,`

       

               <s:iterator begin="1" end="3">
                          <s:property value="top"/>,
               </s:iterator>

       

      By upgrading to jdk 17 It generates `۱, ۲, ۳,` ( these are Persian numbers for `1, 2, 3,`)  

       

      I have asked it at https://stackoverflow.com/questions/77250075/struts-2-and-jdk-17-numbers-in-locale and got a workaround by Roman C.

       

      How ever I think this is something that could be fixed. Developers most of the times, use `s:iterator` to generate numbers which will be used in their code, not to show them to user. 

      So for example a loop which generates 10 inputboxs with names as `inputbox_1, inputbox-2 ... `  will now generate `inputbox_۱, inputbox-۲ ... `.. lots of things need to be changed. ( The JavaScript which you developed base on English number, the name of the variables which was set in action ...)

      I suggest that the `s:iterator` always generates English number, or at list has a property that can be configured. Or even we can configure this behavior globally with an `struts.xml`.

      Attachments

        Activity

          People

            Unassigned Unassigned
            afattahi Alireza Fattahi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h
                2h