public class ContentCachingRequestWrapper extends HttpServletRequestWrapper
http-HttpServletRequest wrapper that caches all content read from
the input stream and reader,
and allows this content to be retrieved via a byte array.
Used e.g. by AbstractRequestLoggingFilter.
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH| Constructor and Description |
|---|
ContentCachingRequestWrapper(HttpServletRequest request)
Create a new ContentCachingRequestWrapper for the given servlet request.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getCharacterEncoding() |
byte[] |
getContentAsByteArray()
Return the cached request content as a byte array.
|
ServletInputStream |
getInputStream() |
BufferedReader |
getReader() |
authenticate, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole, login, logoutgetAsyncContext, getAttribute, getAttributeNames, getContentLength, getContentType, getDispatcherType, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsyncclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAsyncContext, getAttribute, getAttributeNames, getContentLength, getContentType, getDispatcherType, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsyncpublic ContentCachingRequestWrapper(HttpServletRequest request)
request - the original servlet requestpublic ServletInputStream getInputStream() throws IOException
getInputStream in interface ServletRequestgetInputStream in class ServletRequestWrapperIOExceptionpublic String getCharacterEncoding()
getCharacterEncoding in interface ServletRequestgetCharacterEncoding in class ServletRequestWrapperpublic BufferedReader getReader() throws IOException
getReader in interface ServletRequestgetReader in class ServletRequestWrapperIOExceptionpublic byte[] getContentAsByteArray()