java.lang.Object
com.aoapps.servlet.subrequest.ServletSubRequest
- All Implemented Interfaces:
IServletSubRequest,ServletRequest
- Direct Known Subclasses:
HttpServletSubRequest
This does not implement
ServletRequestWrapper and use of it is in violation
of the specification. When used in conjunction with new threads (or threads
from your own pool), Tomcat 7.0 and 8.5 do not notice you switched the request due to its
use of ThreadLocal to enforce the spec. This is very hackish and fragile - use at
your own risk.
Wraps a servlet request with the intent to operate as a concurrent sub request. Any changes made to the request will only affect this request and will not be passed along to the wrapped request.
It is expected that the wrapped request will not change for the life of this wrapper. If it does change, the changes may or may not be visible depending on what has been accessed and changed on this request.
This class is not thread safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(String name) intlongintgetParameter(String name) String[]getParameterValues(String name) getRealPath(String path) Deprecated.intgetRequestDispatcher(String path) intbooleanbooleanbooleanisSecure()voidremoveAttribute(String name) voidsetAttribute(String name, Object o) voidstartAsync(ServletRequest servletRequest, ServletResponse servletResponse)
-
Constructor Details
-
ServletSubRequest
-
-
Method Details
-
getAttribute
- Specified by:
getAttributein interfaceServletRequest
-
getAttributeNames
- Specified by:
getAttributeNamesin interfaceServletRequest
-
setAttribute
- Specified by:
setAttributein interfaceServletRequest
-
removeAttribute
- Specified by:
removeAttributein interfaceServletRequest
-
getCharacterEncoding
- Specified by:
getCharacterEncodingin interfaceServletRequest
-
setCharacterEncoding
- Specified by:
setCharacterEncodingin interfaceServletRequest- Throws:
UnsupportedEncodingException
-
getContentLength
public int getContentLength()- Specified by:
getContentLengthin interfaceServletRequest
-
getContentLengthLong
public long getContentLengthLong()- Specified by:
getContentLengthLongin interfaceServletRequest
-
getContentType
- Specified by:
getContentTypein interfaceServletRequest
-
getInputStream
- Specified by:
getInputStreamin interfaceServletRequest- Throws:
IOException
-
getParameter
- Specified by:
getParameterin interfaceServletRequest
-
getParameterMap
- Specified by:
getParameterMapin interfaceServletRequest
-
getParameterNames
- Specified by:
getParameterNamesin interfaceServletRequest
-
getParameterValues
- Specified by:
getParameterValuesin interfaceServletRequest
-
getProtocol
- Specified by:
getProtocolin interfaceServletRequest
-
getScheme
- Specified by:
getSchemein interfaceServletRequest
-
getServerName
- Specified by:
getServerNamein interfaceServletRequest
-
getServerPort
public int getServerPort()- Specified by:
getServerPortin interfaceServletRequest
-
getReader
- Specified by:
getReaderin interfaceServletRequest- Throws:
IOException
-
getRemoteAddr
- Specified by:
getRemoteAddrin interfaceServletRequest
-
getRemoteHost
- Specified by:
getRemoteHostin interfaceServletRequest
-
getLocale
- Specified by:
getLocalein interfaceServletRequest
-
getLocales
- Specified by:
getLocalesin interfaceServletRequest
-
isSecure
public boolean isSecure()- Specified by:
isSecurein interfaceServletRequest
-
getRequestDispatcher
- Specified by:
getRequestDispatcherin interfaceServletRequest
-
getRealPath
Deprecated.- Specified by:
getRealPathin interfaceServletRequest
-
getRemotePort
public int getRemotePort()- Specified by:
getRemotePortin interfaceServletRequest
-
getLocalName
- Specified by:
getLocalNamein interfaceServletRequest
-
getLocalAddr
- Specified by:
getLocalAddrin interfaceServletRequest
-
getLocalPort
public int getLocalPort()- Specified by:
getLocalPortin interfaceServletRequest
-
getServletContext
- Specified by:
getServletContextin interfaceServletRequest
-
startAsync
- Specified by:
startAsyncin interfaceServletRequest- Throws:
IllegalStateException
-
startAsync
public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws IllegalStateException - Specified by:
startAsyncin interfaceServletRequest- Throws:
IllegalStateException
-
isAsyncStarted
public boolean isAsyncStarted()- Specified by:
isAsyncStartedin interfaceServletRequest
-
isAsyncSupported
public boolean isAsyncSupported()- Specified by:
isAsyncSupportedin interfaceServletRequest
-
getAsyncContext
- Specified by:
getAsyncContextin interfaceServletRequest
-
getDispatcherType
- Specified by:
getDispatcherTypein interfaceServletRequest
-
