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

HiddenHttpMethodFilter does not support multipart requests

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 3.0 GA
    • Fix Version/s: 3.0.2
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      HiddenHttpMethodFilter currently does not work when handling multipart request, as it relies on request.getParameter(..) which does not return the actual parameter's value in multipart requests.

      As I can understand that one might want to keep the filter independent of Spring MVC, I'd suggest to introduce a subclass that might lookup a configured multipartResolver from the application context and use it to obtain the parameters. As we deal with a filter this would require the resolver being declared inside the ApplicationContext loaded by the ContextLoaderListener. This feels a little ugly as one probably should tend to avoid web things inside this ApplicationContext.

      As the only existing implementation is CommonsMultipartResolver and this implementation uses a static method of ServletFileUpload a reasonable way might also be just to check the availablity of Commons Fileupload in the classpath and using this method to determine the multipart nature of the request then.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                juergen.hoeller Juergen Hoeller
                Reporter:
                olivergierke Oliver Gierke
                Last updater:
                Trevor Marshall
              • Votes:
                4 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  7 years, 18 weeks, 3 days ago