0 votes
in Spring by

What is a MultipartResolver and when it’s used?

1 Answer

0 votes
by

MultipartResolver interface is used for uploading files – CommonsMultipartResolver and StandardServletMultipartResolver are two implementations provided by spring framework for file uploading. By default there are no multipart resolvers configured but to use them for uploading files, all we need to define a bean named “multipartResolver” with type as MultipartResolver in spring bean configurations.

Once configured, any multipart request will be resolved by the configured MultipartResolver and pass on a wrapped HttpServletRequest. Then it’s used in the controller class to get the file and process it. For a complete example, please read Spring MVC File Upload Example.

Related questions

0 votes
asked Jul 28, 2020 in Spring by sharadyadav1986
+1 vote
asked Sep 30, 2022 in Nagios by SakshiSharma
...