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
-
Method Summary
Modifier and TypeMethodDescriptiongetAttribute
(String name) int
long
int
getParameter
(String name) String[]
getParameterValues
(String name) getRealPath
(String path) Deprecated.int
getRequestDispatcher
(String path) int
boolean
boolean
boolean
isSecure()
void
removeAttribute
(String name) void
setAttribute
(String name, Object o) void
startAsync
(ServletRequest servletRequest, ServletResponse servletResponse)
-
Constructor Details
-
ServletSubRequest
-
-
Method Details
-
getAttribute
- Specified by:
getAttribute
in interfaceServletRequest
-
getAttributeNames
- Specified by:
getAttributeNames
in interfaceServletRequest
-
setAttribute
- Specified by:
setAttribute
in interfaceServletRequest
-
removeAttribute
- Specified by:
removeAttribute
in interfaceServletRequest
-
getCharacterEncoding
- Specified by:
getCharacterEncoding
in interfaceServletRequest
-
setCharacterEncoding
- Specified by:
setCharacterEncoding
in interfaceServletRequest
- Throws:
UnsupportedEncodingException
-
getContentLength
public int getContentLength()- Specified by:
getContentLength
in interfaceServletRequest
-
getContentLengthLong
public long getContentLengthLong()- Specified by:
getContentLengthLong
in interfaceServletRequest
-
getContentType
- Specified by:
getContentType
in interfaceServletRequest
-
getInputStream
- Specified by:
getInputStream
in interfaceServletRequest
- Throws:
IOException
-
getParameter
- Specified by:
getParameter
in interfaceServletRequest
-
getParameterMap
- Specified by:
getParameterMap
in interfaceServletRequest
-
getParameterNames
- Specified by:
getParameterNames
in interfaceServletRequest
-
getParameterValues
- Specified by:
getParameterValues
in interfaceServletRequest
-
getProtocol
- Specified by:
getProtocol
in interfaceServletRequest
-
getScheme
- Specified by:
getScheme
in interfaceServletRequest
-
getServerName
- Specified by:
getServerName
in interfaceServletRequest
-
getServerPort
public int getServerPort()- Specified by:
getServerPort
in interfaceServletRequest
-
getReader
- Specified by:
getReader
in interfaceServletRequest
- Throws:
IOException
-
getRemoteAddr
- Specified by:
getRemoteAddr
in interfaceServletRequest
-
getRemoteHost
- Specified by:
getRemoteHost
in interfaceServletRequest
-
getLocale
- Specified by:
getLocale
in interfaceServletRequest
-
getLocales
- Specified by:
getLocales
in interfaceServletRequest
-
isSecure
public boolean isSecure()- Specified by:
isSecure
in interfaceServletRequest
-
getRequestDispatcher
- Specified by:
getRequestDispatcher
in interfaceServletRequest
-
getRealPath
Deprecated.- Specified by:
getRealPath
in interfaceServletRequest
-
getRemotePort
public int getRemotePort()- Specified by:
getRemotePort
in interfaceServletRequest
-
getLocalName
- Specified by:
getLocalName
in interfaceServletRequest
-
getLocalAddr
- Specified by:
getLocalAddr
in interfaceServletRequest
-
getLocalPort
public int getLocalPort()- Specified by:
getLocalPort
in interfaceServletRequest
-
getServletContext
- Specified by:
getServletContext
in interfaceServletRequest
-
startAsync
- Specified by:
startAsync
in interfaceServletRequest
- Throws:
IllegalStateException
-
startAsync
public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws IllegalStateException - Specified by:
startAsync
in interfaceServletRequest
- Throws:
IllegalStateException
-
isAsyncStarted
public boolean isAsyncStarted()- Specified by:
isAsyncStarted
in interfaceServletRequest
-
isAsyncSupported
public boolean isAsyncSupported()- Specified by:
isAsyncSupported
in interfaceServletRequest
-
getAsyncContext
- Specified by:
getAsyncContext
in interfaceServletRequest
-
getDispatcherType
- Specified by:
getDispatcherType
in interfaceServletRequest
-