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

MockHttpServletRequest.buildRequest() should work for parameters with multiple values with multipart content type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5.11
    • 6.18.0, 1.5.13, 7.0.0-M4
    • wicket
    • None

    Description

      The following code in the method MockHttpServletRequest.buildRequest() iterates over all values of a parameter. When writing the value to the outputstream it doesn't use the iteration variable, but instead retrieves the value with "post.getParameterValue(parameterName)" which always returns the first element of the list.

      			List<StringValue> values = post.getParameterValues(parameterName);
      				for (StringValue value : values)
      				{
      					newAttachment(out);
      					out.write("; name=\"".getBytes());
      					out.write(parameterName.getBytes());
      					out.write("\"".getBytes());
      					out.write(crlf.getBytes());
      					out.write(crlf.getBytes());
      					out.write(post.getParameterValue(parameterName).toString().getBytes());
      					out.write(crlf.getBytes());
      				}
      

      So for a given list of values "3", "2" and "1", it actually writes "3", "3" and "3".

      Attachments

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            dennis.waldherr@bosch-fs.com Dennis Waldherr
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: