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

Don't set values to map with integer keys

    XMLWordPrintableJSON

Details

    Description

      Parameters binding don't work properly when parameter 'map[key]' given from jsp, but if 'key' field will be an instance of String, it's work.
      In jsp it's don't work, too.
      The tag <s:property value="map[key]" /> will display empty string.

      class SomeAction {
      Integer key = 1;
      Map map = new HashMap();
      void setKey(Integer value)

      { this.key = key; }

      Integer getKey()

      { return key; }

      Map getMap()

      { return map; }

      void setMap(Map map)

      { this.map = map; }

      public String execute()

      { System.out.println("map[key]: " + map.get(key)); return "success"; }

      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            vladimir.balandin Vladimir A. Balandin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: