Skip to content

HiddenHttpMethodFilter does not support multipart requests [SPR-6594] #11260

@spring-projects-issues

Description

@spring-projects-issues

Oliver Drotbohm opened SPR-6594 and commented

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.


Affects: 3.0 GA

Issue Links:

Referenced from: commits 2c9753a, 0eabef0

4 votes, 11 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions