java.lang.Object | |||
↳ | org.springframework.web.filter.GenericFilterBean | ||
↳ | org.springframework.web.filter.OncePerRequestFilter | ||
↳ | org.springframework.web.multipart.support.MultipartFilter |
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).
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. HiddenHttpMethodFilter
).
In any case, this filter should not be combined with servlet-specific multipart resolution.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | DEFAULT_MULTIPART_RESOLVER_BEAN_NAME |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.web.filter.OncePerRequestFilter
|
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.web.filter.GenericFilterBean
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Set the bean name of the MultipartResolver to fetch from Spring's
root application context.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Check for a multipart request via this filter's MultipartResolver,
and wrap the original request with a MultipartHttpServletRequest if appropriate.
| |||||||||||
Return the bean name of the MultipartResolver to fetch from Spring's
root application context.
| |||||||||||
Look up the MultipartResolver that this filter should use,
taking the current HTTP request as argument.
| |||||||||||
Look for a MultipartResolver bean in the root web application context.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.web.filter.OncePerRequestFilter
| |||||||||||
From class
org.springframework.web.filter.GenericFilterBean
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
javax.servlet.Filter
| |||||||||||
From interface
org.springframework.beans.factory.BeanNameAware
| |||||||||||
From interface
org.springframework.beans.factory.DisposableBean
| |||||||||||
From interface
org.springframework.beans.factory.InitializingBean
| |||||||||||
From interface
org.springframework.context.EnvironmentAware
| |||||||||||
From interface
org.springframework.web.context.ServletContextAware
|
Set the bean name of the MultipartResolver to fetch from Spring's root application context. Default is "filterMultipartResolver".
Check for a multipart request via this filter's MultipartResolver, and wrap the original request with a MultipartHttpServletRequest if appropriate.
All later elements in the filter chain, most importantly servlets, benefit from proper parameter extraction in the multipart case, and are able to cast to MultipartHttpServletRequest if they need to.
IOException | |
---|---|
ServletException |
Return the bean name of the MultipartResolver to fetch from Spring's root application context.
Look up the MultipartResolver that this filter should use, taking the current HTTP request as argument.
Default implementation delegates to the lookupMultipartResolver
without arguments.
Look for a MultipartResolver bean in the root web application context. Supports a "multipartResolverBeanName" filter init param; the default bean name is "filterMultipartResolver".
This can be overridden to use a custom MultipartResolver instance, for example if not using a Spring web application context.
null
if none found