类 StandardMultipartHttpServletRequest
- java.lang.Object
- javax.servlet.ServletRequestWrapper
- javax.servlet.http.HttpServletRequestWrapper
- org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest
- org.springframework.web.multipart.support.StandardMultipartHttpServletRequest
public class StandardMultipartHttpServletRequest extends AbstractMultipartHttpServletRequest
Spring MultipartHttpServletRequest adapter, wrapping a Servlet 3.0 HttpServletRequest and its Part objects. Parameters get exposed through the native request's getParameter methods - without any custom processing on our side.- 从以下版本开始:
- 3.1
- 作者:
- Juergen Hoeller, Rossen Stoyanchev
- 另请参阅:
StandardServletMultipartResolver
字段概要
从接口继承的字段 javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
构造器概要
构造器 构造器 说明 StandardMultipartHttpServletRequest(HttpServletRequest request)
Create a new StandardMultipartHttpServletRequest wrapper for the given request, immediately parsing the multipart content.StandardMultipartHttpServletRequest(HttpServletRequest request, boolean lazyParsing)
Create a new StandardMultipartHttpServletRequest wrapper for the given request.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 String
getMultipartContentType(String paramOrFileName)
Determine the content type of the specified request part.HttpHeaders
getMultipartHeaders(String paramOrFileName)
Return the headers associated with the specified part of the multipart request.Map<String,String[]>
getParameterMap()
The default behavior of this method is to return getParameterMap() on the wrapped request object.Enumeration<String>
getParameterNames()
The default behavior of this method is to return getParameterNames() on the wrapped request object.protected void
handleParseFailure(Throwable ex)
protected void
initializeMultipart()
Lazily initialize the multipart request, if possible.从类继承的方法 org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest
getFile, getFileMap, getFileNames, getFiles, getMultiFileMap, getMultipartFiles, getRequest, getRequestHeaders, getRequestMethod, isResolved, setMultipartFiles
从类继承的方法 javax.servlet.http.HttpServletRequestWrapper
authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getHttpServletMapping, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getTrailerFields, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isTrailerFieldsReady, isUserInRole, login, logout, newPushBuilder, upgrade
从类继承的方法 javax.servlet.ServletRequestWrapper
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsync
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 javax.servlet.http.HttpServletRequest
authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getHttpServletMapping, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getTrailerFields, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isTrailerFieldsReady, isUserInRole, login, logout, newPushBuilder, upgrade
从接口继承的方法 javax.servlet.ServletRequest
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
构造器详细资料
StandardMultipartHttpServletRequest
public StandardMultipartHttpServletRequest(HttpServletRequest request) throws MultipartException
Create a new StandardMultipartHttpServletRequest wrapper for the given request, immediately parsing the multipart content.- 参数:
request
- the servlet request to wrap- 抛出:
MultipartException
- if parsing failed
StandardMultipartHttpServletRequest
public StandardMultipartHttpServletRequest(HttpServletRequest request, boolean lazyParsing) throws MultipartException
Create a new StandardMultipartHttpServletRequest wrapper for the given request.- 参数:
request
- the servlet request to wraplazyParsing
- whether multipart parsing should be triggered lazily on first access of multipart files or parameters- 抛出:
MultipartException
- if an immediate parsing attempt failed- 从以下版本开始:
- 3.2.9
方法详细资料
handleParseFailure
protected void handleParseFailure(Throwable ex)
initializeMultipart
protected void initializeMultipart()
从类复制的说明:AbstractMultipartHttpServletRequest
Lazily initialize the multipart request, if possible. Only called if not already eagerly initialized.
getParameterNames
public Enumeration<String> getParameterNames()
从类复制的说明:javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getParameterNames() on the wrapped request object.- 指定者:
getParameterNames
在接口中ServletRequest
- 覆盖:
getParameterNames
在类中ServletRequestWrapper
- 返回:
- an
Enumeration
ofString
objects, eachString
containing the name of a request parameter; or an emptyEnumeration
if the request has no parameters
getParameterMap
public Map<String,String[]> getParameterMap()
从类复制的说明:javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getParameterMap() on the wrapped request object.- 指定者:
getParameterMap
在接口中ServletRequest
- 覆盖:
getParameterMap
在类中ServletRequestWrapper
- 返回:
- an immutable java.util.Map containing parameter names as keys and parameter values as map values. The keys in the parameter map are of type String. The values in the parameter map are of type String array.
getMultipartContentType
public String getMultipartContentType(String paramOrFileName)
从接口复制的说明:MultipartRequest
Determine the content type of the specified request part.- 参数:
paramOrFileName
- the name of the part- 返回:
- the associated content type, or
null
if not defined
getMultipartHeaders
public HttpHeaders getMultipartHeaders(String paramOrFileName)
从接口复制的说明:MultipartHttpServletRequest
Return the headers associated with the specified part of the multipart request.If the underlying implementation supports access to headers, then all headers are returned. Otherwise, the returned headers will include a 'Content-Type' header at the very least.