|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for multipart resolution strategies that handle file uploads as defined in RFC 1867. Implementations are typically usable both within any application context and standalone.
There are two concrete implementations included in Spring:
There is no default resolver implementation used for Spring DispatcherServlets, as an application might choose to parse its multipart requests itself. To define an implementation, create a bean with the id "multipartResolver" in a DispatcherServlet's application context. Such a resolver gets applied to all requests handled by that DispatcherServlet. Use RequestContextUtils.getMultipartResolver() to retrieve the current resolver in controllers etc, independent of the actual resolution strategy.
MultipartHttpServletRequest
,
MultipartFile
,
CommonsMultipartResolver
,
CosMultipartResolver
,
DispatcherServlet
,
RequestContextUtils.getMultipartResolver(javax.servlet.http.HttpServletRequest)
Method Summary | |
void |
cleanupMultipart(MultipartHttpServletRequest request)
Cleanup any resources used for the multipart handling, like a storage for the uploaded files. |
boolean |
isMultipart(javax.servlet.http.HttpServletRequest request)
Determine if the request contains multipart content. |
MultipartHttpServletRequest |
resolveMultipart(javax.servlet.http.HttpServletRequest request)
Wrap the servlet request inside a MultipartHttpServletRequest. |
Method Detail |
public boolean isMultipart(javax.servlet.http.HttpServletRequest request)
Will typically check for content type "multipart/form-data", but the actually accepted requests might depend on the capabilities of the resolver implementation.
request
- the servlet request to be evaluated
true
if the request contains multipart content;
false
otherwisepublic MultipartHttpServletRequest resolveMultipart(javax.servlet.http.HttpServletRequest request) throws MultipartException
request
- the servlet request to wrap (must be of a multipart content type)
MultipartException
- if the servlet request is not multipart, or if
implementation-specific problems are encountered (such as exceeding file size limits)public void cleanupMultipart(MultipartHttpServletRequest request)
request
- the request to cleanup resources for
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |