Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-15828

Parameter values are null when making a PUT request

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 4.3.10, 5.0 RC3
    • Fix Version/s: 4.3.11, 5.0 RC4
    • Component/s: Web
    • Labels:
    • Last commented by a User:
      false

      Description

      Hello,

      here's the setup. I have a controller which is mapped to PUT request method. Spring-boot configures HttpPutFormContentFilter and in 4.3.8 the method in HttpPutFormContentRequestWrapper:getParameterValues looks like this:

      			String[] queryStringValues = super.getParameterValues(name);
      			List<String> formValues = this.formParameters.get(name);
      			if (formValues == null) {
      				return queryStringValues;
      			}
                             //more
      

      So because super.getParameterValues(name) returns correct value and the formParameters.get(name) returns null, the the correct value from queryStringValues is returned.

      Now in 4.3.9 this method looks like this:

      			String[] queryParam = (super.getQueryString() != null ? super.getParameterValues(name) : null);
      			List<String> formParam = this.formParameters.get(name);
      			if (formParam == null) {
      				return queryParam;
      			}
                             // more 
      

      Now because the super.getQueryString() is null and the formParam is null too then null is returned.

      Why has this been changed? Do I need to change my forms too? I was assuming my code should work in both 4.3.8 and 4.3.9

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rstoya05-aop Rossen Stoyanchev
                Reporter:
                ptahchiev Petar Tahchiev
                Last updater:
                St├ęphane Nicoll
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  44 weeks ago