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

Binding Integer Array upon form submission

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Not A Problem
    • Affects Version/s: 2.5.20
    • Fix Version/s: 2.5.22, 2.6
    • Component/s: None
    • Labels:
      None

      Description

      We have just migrated our application on struts 2.5.20.
      In one of our use-cases, we have two checkboxes with same "name" attribute and upon submission, they submit integer values that we bind with Integer array being defined in the action.
      After migration, that thing stopped working.
      Here is my code snippet in JSP:

      <input type="checkbox" name="rfaAccessType" value="1" id="rfaacess_STORAGE">

      <input type="checkbox" name="rfaAccessType" value="2" id="rfaacess_SERVER">

       

      Here is the integer array in Action class (Setters and getters also defined)

      private Integer[] rfaAccessType;

       

      I need your help to remediate this issue. If this way of submitting form and binding it to an array still supported in Struts? If not, what should I do so that I have minimum change in my code?

       

       

       

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mfsalmani678 Muhammad Salman
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: