public class CachingHttpServletRequest extends HttpServletRequestWrapper
HttpServletRequest and preloads the body into memory for debugging purposes.BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH| Modifier | Constructor and Description |
|---|---|
protected |
CachingHttpServletRequest(HttpServletRequest req)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBody()
Returns the body of the servlet request without consuming the stream.
|
ServletInputStream |
getInputStream() |
static CachingHttpServletRequest |
wrap(HttpServletRequest req)
Wraps the specified request inside a
CachingHttpServletRequest if it isn't already. |
authenticate, changeSessionId, 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, logout, upgradegetAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, 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, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsyncprotected CachingHttpServletRequest(HttpServletRequest req) throws IOException
req - The request being wrapped.IOException - If body could not be loaded into memory.public static CachingHttpServletRequest wrap(HttpServletRequest req) throws IOException
CachingHttpServletRequest if it isn't already.req - The request to wrap.IOException - Thrown by underlying body stream.public ServletInputStream getInputStream()
getInputStream in interface ServletRequestgetInputStream in class ServletRequestWrapperpublic byte[] getBody()
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.