Wicket
  1. Wicket
  2. WICKET-5074

Improvement for MockHttpServletRequest and FormTester to support 'multiple' input type of fileUpload

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 6.6.0
    • Fix Version/s: 6.7.0
    • Component/s: wicket
    • Labels:
      None

      Description

      Right now MockHttpServletRequest keeps a Map<String, UploadedFile> uploadedFiles to simulate the uploads, but that only covers multiple FileUploadFields in the Page(each holding a single upload file).
      When doing MockHttpServletRequest.addFile(...), it does not add the file to a list, but rather replaces the last one:
      uploadedFiles.put(fieldName, uf);

      However with the HTML5 type of input type multiple="multiple", FileUploadField.getFileUploads() returns list of uploaded files, so I guess that MockHttpServletRequest should honor this and keep the files into Map<String, List<UploadedFile>>.

        Activity

        Martin Grigorov made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Martin Grigorov [ mgrigorov ]
        Fix Version/s 6.7.0 [ 12323964 ]
        Resolution Fixed [ 1 ]
        Serban Balamaci made changes -
        Description Right now MockHttpServletRequest keeps a Map<String, UploadedFile> uploadedFiles to simulate the uploads, but that only covers multiple FileUploadFields in the Page(each holding a single upload file).
        When doing MockHttpServletRequest.addFile(...), it does not append the file to a list, but rather replaces the last one:
        uploadedFiles.put(fieldName, uf);
         
        However with the HTML5 type of input type multiple="multiple", FileUploadField.getFileUploads() returns list of uploaded files, so I guess that MockHttpServletRequest should honor this and keep the files into Map<String, List<UploadedFile>>.
        Right now MockHttpServletRequest keeps a Map<String, UploadedFile> uploadedFiles to simulate the uploads, but that only covers multiple FileUploadFields in the Page(each holding a single upload file).
        When doing MockHttpServletRequest.addFile(...), it does not add the file to a list, but rather replaces the last one:
        uploadedFiles.put(fieldName, uf);
         
        However with the HTML5 type of input type multiple="multiple", FileUploadField.getFileUploads() returns list of uploaded files, so I guess that MockHttpServletRequest should honor this and keep the files into Map<String, List<UploadedFile>>.
        Serban Balamaci made changes -
        Field Original Value New Value
        Description Right now MockHttpServletRequest keeps a Map<String, UploadedFile> uploadedFiles to simulate the uploads, but that only covers multiple file uploads fields each holding a single upload file.
        When doing MockHttpServletRequest.addFile(...), it does not append the file to a list, but rather replaces the last one:
        uploadedFiles.put(fieldName, uf);
         
        However with the HTML5 type of input type multiple="multiple", FileUploadField.getFileUploads() returns list of uploaded files, so I guess that MockHttpServletRequest should honor this and keep the files into Map<String, List<UploadedFile>>.
        Right now MockHttpServletRequest keeps a Map<String, UploadedFile> uploadedFiles to simulate the uploads, but that only covers multiple FileUploadFields in the Page(each holding a single upload file).
        When doing MockHttpServletRequest.addFile(...), it does not append the file to a list, but rather replaces the last one:
        uploadedFiles.put(fieldName, uf);
         
        However with the HTML5 type of input type multiple="multiple", FileUploadField.getFileUploads() returns list of uploaded files, so I guess that MockHttpServletRequest should honor this and keep the files into Map<String, List<UploadedFile>>.
        Serban Balamaci created issue -

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Serban Balamaci
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development