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

ServletWebRequest Post Parameters missing

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 6.18.0, 6.19.0
    • Fix Version/s: None
    • Component/s: wicket
    • Labels:
      None

      Description

      To Reproduce:

      I was able to easily reproduce it with the simplest submit button: https://github.com/baholladay/wicketrequesterror

      All you need to do is click submit and you'll see the parameter value. Then change the wicket version from 6.16.0 to 6.19.0 and rebuild and click submit and you'll see no value after clicking submit.

      Description:
      I'm trying to upgrade to 6.19.0 from 6.16.0 and one of my rest endpoints doesn't have access to the post parameters anymore.

      I mount a specific endpoint to a page:

      Application.java

      mountPage("/fileUpload", FileUploadRest.class);

      and then look for the parameters in the page

      FileUploadRest extends WebPage{

      public FileUploadRest(){
      final ServletWebRequest webRequest = (ServletWebRequest) getRequest();
      MultipartServletWebRequest multiPartRequest = webRequest.newMultipartWebRequest(Bytes.megabytes(100), "ignored");
      String uuid = multiPartRequest.getRequestParameters().getParameterValue("uuid").toString();
      ...
      }
      This UUID parameter works fine in 6.16.0 but is always null in 6.19.0. This is true for all parameters and the file passed in. I verified that the post is sending the data (by looking at the developer Network tab in chrome).

      Request Payload:

      ------WebKitFormBoundaryttKBVItmK4S1fZNP

      Content-Disposition: form-data; name="myAwesomeDropzone_hf_0"

      ------WebKitFormBoundaryttKBVItmK4S1fZNP
      Content-Disposition: form-data; name="uuid"

      4e238b39-478d-4938-8bc2-0416508b04c6
      ------WebKitFormBoundaryttKBVItmK4S1fZNP
      Content-Disposition: form-data; name="file"; filename="test4.pdf"
      Content-Type: application/pdf

      I've also tried using a Resource and mounting that instead of a WebPage by following the stackoverflow suggestion [1], but got the same results where no parameters were being passed through.

      [1] http://stackoverflow.com/questions/17874695/wicket-http-post-get-raw-data-from-servletrequest

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                baholladay Bryan Holladay
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: