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

Radio tag does not support value objects of type Boolean when setting the default value

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 6.3.0
    • 6.4.0
    • Core Tags
    • None

    Description

      Github proof of concept project here: https://github.com/ikannak/RadioPoC

      The fix for WW-5192 introduced a regression when using a Boolean type value object in a s:radio tag. When using a radio map as shown in the linked PoC project in index.jsp, Struts 2 6.0.3 and later won't set the checked property of the relevant radio input. This appears to be because the value is now considered a String rather than an Object, leading to parameters.nameValue being set to the property name rather than the value of the underlying object. In Struts versions before 6.0.3 (tested with 2.5.32 and 2.5.22), it would use the boolean true/false version of the value object as nameValue, but when tested with version 6.3.0.1, it instead is set to the literal value of the s:radio value attribute.

      Note that this also does not match the official documentation: according to the official tag developers guide at https://struts.apache.org/tag-developers/tag-syntax#value-is-an-object, value is intended to be an object.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Kerkhofs Nate
              Votes:
              0 Vote for this issue
              Watchers:
              1 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 - 40m
                  40m