Skip to content

Commit

Permalink
Document removal of CommonsMultipartResolver in MVC setup documentation
Browse files Browse the repository at this point in the history
Closes gh-29562
  • Loading branch information
jhoeller committed Nov 24, 2022
1 parent a3c8909 commit 8391897
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions framework-docs/src/docs/asciidoc/web/webmvc.adoc
Expand Up @@ -1141,9 +1141,10 @@ request with a simple request parameter.
[.small]#<<web-reactive.adoc#webflux-multipart, WebFlux>>#

`MultipartResolver` from the `org.springframework.web.multipart` package is a strategy
for parsing multipart requests including file uploads. There is one implementation
based on https://commons.apache.org/proper/commons-fileupload[Commons FileUpload] and
another based on Servlet multipart request parsing.
for parsing multipart requests including file uploads. There is a container-based
`StandardServletMultipartResolver` implementation for Servlet multipart request parsing.
Note that the outdated `CommonsMultipartResolver` based on Apache Commons FileUpload is
not available anymore, as of Spring Framework 6.0 with its new Servlet 5.0+ baseline.

To enable multipart handling, you need to declare a `MultipartResolver` bean in your
`DispatcherServlet` Spring configuration with a name of `multipartResolver`.
Expand All @@ -1153,26 +1154,6 @@ content wraps the current `HttpServletRequest` as a `MultipartHttpServletRequest
provide access to resolved files in addition to exposing parts as request parameters.


[[mvc-multipart-resolver-commons]]
==== Apache Commons `FileUpload`

To use Apache Commons `FileUpload`, you can configure a bean of type
`CommonsMultipartResolver` with a name of `multipartResolver`. You also need to have
the `commons-fileupload` jar as a dependency on your classpath.

This resolver variant delegates to a local library within the application, providing
maximum portability across Servlet containers. As an alternative, consider standard
Servlet multipart resolution through the container's own parser as discussed below.

[NOTE]
====
Commons FileUpload traditionally applies to POST requests only but accepts any
`multipart/` content type. See the
{api-spring-framework}/web/multipart/commons/CommonsMultipartResolver.html[`CommonsMultipartResolver`]
javadoc for details and configuration options.
====


[[mvc-multipart-resolver-standard]]
==== Servlet Multipart Parsing

Expand Down

0 comments on commit 8391897

Please sign in to comment.