Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-1876

RequestUtils.decodeParameters(String, ValueMap) doesn't follow the Servlet spec

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 1.3.4
    • 1.4-RC2
    • wicket
    • None
    • Any

    Description

      RequestUtils.decodeParameters(String, ValueMap) fills a (Value)Map with values of type java.lang.String while it
      has to fill values of type String[] because by Servlet API java.servlet.ServletRequest.getParameterValues(String) returns String[].

      How I get to this:
      mockHttpServletRequest.setUrl("http://dummy.com?param1=value1") -> this calls RequestUtils.decodeParameters(queryString, parameters);
      Later when I do mockHttpServletRequest.getParameterMap() and iterate over it I expect the values to be of type String[].

      A trivial (and wrong) fix would be to put "new String[]

      {currentValue}

      " in the map. The proper fix is to collect all values per parameter name and create an array of them.

      Attachments

        1. WICKET-1876.patch.txt
          9 kB
          Martin Grigorov

        Activity

          People

            jdonnerstag Juegen Donnerstag
            martin-g Martin Grigorov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: