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

org.apache.struts2.util.ContainUtil.contains

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.1.6
    • 2.1.8
    • Expression Language
    • None
    • All

    Description

      When we use a

      String[] selectedValues in the Action and the beans keys are for example Long this is not working

      <@s.checkboxlist name="selectedValues" list=q.choices listKey="id" listValue="label" />

      (id is a Long)

      It's working if we use a java.util.List selectedValues

      The issue comes from ContainUtil class

      In arrays we don't check the String value

      if (obj1 instanceof Iterable) {
      ...
      if (obj2.equals(value) || obj2.toString().equals(value))

      { //(works ok) BUT }

      else if (obj1.getClass().isArray()) {
      ...
      if (value.equals(obj2)) { //(it's not working)

      Thanks

      Luis

      Attachments

        Activity

          People

            Unassigned Unassigned
            luisgervaso Luis Gervaso Martin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: