Allow plugin REST resources to iterate over multipart form fields

XMLWordPrintable

      REST resources can currently access MultiPart form contents in the following ways:

      @POST
      @Consumes(MediaType.MULTIPART_FORM_DATA)
      @Path("/path")
      public Response postMethod(@MultipartFormParam("field1") FilePart file,
                                 @MultipartFormParam("field2") List<FilePart> files,
                                 @Context MultipartHandler multipartHandler,
                                 @Context HttpServletRequest request) {
          MultipartForm form = multipartHandler.getForm(request);
          Collection<FilePart> fileParts = form.getFileParts("field3");

      However, there is currently no way to access parts for which a field name is not specified - i.e. determined by the client.

      This is in contrast to Struts MultiPart requests where all fields can be iterated over.

      This limitation prevents the migration of Struts Actions which rely on dynamic multipart form fields to a REST equivalent.

            Assignee:
            Kusal Kithul-Godage
            Reporter:
            Kusal Kithul-Godage
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: