public class ResettableRequestServletWrapper
extends javax.servlet.http.HttpServletRequestWrapper
HttpServletRequestWrapper those ServletInputStream is
cached and can be reset and read again as often as necessary.| Modifier and Type | Method and Description |
|---|---|
int |
getContentLength() |
javax.servlet.ServletInputStream |
getInputStream() |
BufferedReader |
getReader() |
void |
resetInputStream()
Will rewind the
ServletInputStream to its beginning so it can be
read again. |
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, getContentLengthLong, 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, getCharacterEncoding, getContentLengthLong, 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 void resetInputStream()
throws IOException
ServletInputStream to its beginning so it can be
read again.
Additionally the getReader() will be removed if it was used. It will be
created again on its next usage.
Before resetting the stream the first time it has to be read entirely. The reset will only provide a view from position 0 to the already read bytes from that stream. If the stream wasn't read at all the content will be empty.
IOExceptionpublic javax.servlet.ServletInputStream getInputStream()
throws IOException
getInputStream in interface javax.servlet.ServletRequestgetInputStream in class javax.servlet.ServletRequestWrapperIOExceptionpublic BufferedReader getReader() throws IOException
getReader in interface javax.servlet.ServletRequestgetReader in class javax.servlet.ServletRequestWrapperIOExceptionpublic int getContentLength()
getContentLength in interface javax.servlet.ServletRequestgetContentLength in class javax.servlet.ServletRequestWrapperCopyright © 2016–2019 Atlassian. All rights reserved.