|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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. Supports a "multipartResolverBeanName" filter init-param; the default bean name is "filterMultipartResolver".
MultipartResolver determination is customizable: Override this filter's getMultipartResolver method to use a custom MultipartResolver instance, for example if not using a Spring web application context.
Note: This filter is an alternative to using DispatcherServlet's MultipartResolver support, for example for web applications with custom web views that do not use Spring's web MVC. It should not be combined with servlet-specific multipart resolution.
MultipartResolver
,
DispatcherServlet
Field Summary | |
static java.lang.String |
DEFAULT_MULTIPART_RESOLVER_BEAN_NAME
|
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter |
ALREADY_FILTERED_SUFFIX |
Fields inherited from class org.springframework.web.filter.GenericFilterBean |
logger |
Constructor Summary | |
MultipartFilter()
|
Method Summary | |
protected void |
doFilterInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain filterChain)
Check for a multipart request via this filter's MultipartResolver, and wrap the original request with a MultipartHttpServletRequest if appropriate. |
protected java.lang.String |
getMultipartResolverBeanName()
Return the bean name of the MultipartResolver to fetch from Spring's root application context. |
protected void |
initFilterBean()
Fetch a reference to the MultipartResolver via lookupMultipartResolver and stores it for use in this filter. |
protected MultipartResolver |
lookupMultipartResolver()
Look for a MultipartResolver bean in the root web application context. |
void |
setMultipartResolverBeanName(java.lang.String multipartResolverBeanName)
Set the bean name of the MultipartResolver to fetch from Spring's root application context. |
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter |
doFilter, getAlreadyFilteredAttributeName, shouldNotFilter |
Methods inherited from class org.springframework.web.filter.GenericFilterBean |
addRequiredProperty, destroy, getFilterConfig, getFilterName, getServletContext, init |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String DEFAULT_MULTIPART_RESOLVER_BEAN_NAME
Constructor Detail |
public MultipartFilter()
Method Detail |
public void setMultipartResolverBeanName(java.lang.String multipartResolverBeanName)
protected java.lang.String getMultipartResolverBeanName()
protected void initFilterBean() throws javax.servlet.ServletException
initFilterBean
in class GenericFilterBean
javax.servlet.ServletException
- if subclass initialization failslookupMultipartResolver()
protected MultipartResolver lookupMultipartResolver()
This can be overridden to use a custom MultipartResolver instance, for example if not using a Spring web application context.
protected void doFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain) throws javax.servlet.ServletException, java.io.IOException
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.
doFilterInternal
in class OncePerRequestFilter
javax.servlet.ServletException
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |