Servlet 2.3 Filter that resolves multipart requests via a MultipartResolver. in the root web application context.
Looks up the MultipartResolver in Spring's root web application context. Supports a "multipartResolverBeanName" filter init-param in web.xml
; the default bean name is "filterMultipartResolver". Looks up the MultipartResolver on each request, to avoid initialization order issues (when using ContextLoaderServlet, the root application context will get initialized after this filter).
If no MultipartResolver bean is found, this filter falls back to a default MultipartResolver: {@link StandardServletMultipartResolver} for Servlet 3.0,based on a multipart-config section in web.xml
.
MultipartResolver lookup is customizable: Override this filter's lookupMultipartResolver
method to use a custom MultipartResolver instance, for example if not using a Spring web application context. Note that the lookup method should not create a new MultipartResolver instance for each call but rather return a reference to a pre-built instance.
Note: This filter is an alternative to using DispatcherServlet's MultipartResolver support, for example for web applications with custom web views which do not use Spring's web MVC, or for custom filters applied before a Spring MVC DispatcherServlet (e.g. {@link org.springframework.web.filter.HiddenHttpMethodFilter}). In any case, this filter should not be combined with servlet-specific multipart resolution.
@author Juergen Hoeller
@since 08.10.2003
@see #setMultipartResolverBeanName
@see #lookupMultipartResolver
@see org.springframework.web.multipart.MultipartResolver
@see org.springframework.web.servlet.DispatcherServlet