public final class HttpServletRequestImpl extends AbstractCauchoRequest implements CauchoRequest, WebSocketServletRequest
AbstractCauchoRequest.PartImplBASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH| Constructor and Description |
|---|
HttpServletRequestImpl(AbstractHttpRequest request)
Create a new Request.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCloseOnExit(Path path)
Adds a file to be removed at the end.
|
void |
cleanup() |
protected java.lang.String |
findSessionIdFromCookie()
Returns the session id in the HTTP request cookies.
|
void |
finishInvocation() |
protected void |
finishRequest() |
AbstractHttpRequest |
getAbstractHttpRequest() |
AsyncContextImpl |
getAsyncContext()
Returns the async context for the request
|
java.lang.Object |
getAttribute(java.lang.String name)
Returns the value of the named request attribute.
|
java.util.Enumeration<java.lang.String> |
getAttributeNames()
Returns an enumeration of the request attribute names.
|
java.lang.String |
getAuthType()
Gets the authorization type
|
java.lang.String |
getCharacterEncoding()
Returns the character encoding of the POSTed data.
|
SocketLink |
getConnection() |
int |
getContentLength()
Returns the content length of the data.
|
java.lang.String |
getContentType()
Returns the request's mime-type.
|
java.lang.String |
getContextPath()
Returns the context part of the uri.
|
Cookie |
getCookie(java.lang.String name)
Returns the named cookie from the browser
|
Cookie[] |
getCookies()
Returns an array of all cookies sent by the client.
|
long |
getDateHeader(java.lang.String name)
Converts a date header to milliseconds since the epoch.
|
DispatcherType |
getDispatcherType()
Returns DispatcherType
|
boolean |
getHasCookie()
True if this page uses cookies.
|
java.lang.String |
getHeader(java.lang.String name)
Returns the first value for a request header.
|
java.util.Enumeration<java.lang.String> |
getHeaderNames()
Returns an enumeration of all headers sent by the client.
|
java.util.Enumeration<java.lang.String> |
getHeaders(java.lang.String name)
Returns all the values for a request header.
|
ServletInputStream |
getInputStream()
Returns an InputStream to retrieve POST data from the request.
|
int |
getIntHeader(java.lang.String name)
Converts a header value to an integer.
|
Invocation |
getInvocation() |
java.lang.String |
getLocalAddr()
This call returns the ip of the host actually used to connect to the Resin
server, which means that if ipchains, load balancing, or proxying is
involved this call does not return the correct host for
forming urls.
|
java.util.Locale |
getLocale()
Returns the request's preferred locale, based on the Accept-Language
header.
|
java.util.Enumeration<java.util.Locale> |
getLocales()
Returns an enumeration of all locales acceptable by the client.
|
java.lang.String |
getLocalName()
Returns the IP address of the local host, i.e.
|
int |
getLocalPort()
Returns the port of the local host.
|
protected Login |
getLogin()
Returns the login for the request.
|
java.lang.String |
getMethod()
Returns the HTTP method, e.g.
|
java.lang.String |
getPageContextPath()
Returns the context part of the uri.
|
java.lang.String |
getPagePathInfo()
Returns the portion of the uri after the servlet path for the current
page.
|
java.lang.String |
getPageQueryString()
Returns the current page's query string.
|
java.lang.String |
getPageServletPath()
Returns the portion of the uri mapped to the servlet for the current
page.
|
java.lang.String |
getPageURI()
Returns the URI for the page.
|
java.lang.String |
getPathInfo()
Returns the portion of the uri after the servlet path for the original
request.
|
java.lang.String |
getPathTranslated()
Returns the real path of pathInfo.
|
java.lang.String |
getProtocol()
Returns the prococol, e.g.
|
java.lang.String |
getQueryString()
Returns the current page's query string.
|
java.io.BufferedReader |
getReader()
Returns a reader to read POSTed data.
|
java.lang.String |
getRealPath(java.lang.String path)
Deprecated.
As of JSDK 2.1
|
java.lang.String |
getRemoteAddr()
Returns the IP address of the remote host, i.e.
|
java.lang.String |
getRemoteHost()
Returns the DNS hostname of the remote host, i.e.
|
int |
getRemotePort()
Returns the port of the remote host, i.e.
|
java.lang.String |
getRemoteUser()
Gets the remote user from the authorization type
|
java.lang.String |
getRemoteUser(boolean create)
Internal logging return to get the remote user.
|
int |
getRequestDepth(int depth) |
RequestDispatcher |
getRequestDispatcher(java.lang.String path)
Returns a request dispatcher for later inclusion or forwarding.
|
java.lang.String |
getRequestedSessionId()
Returns the session id in the HTTP request.
|
java.lang.String |
getRequestedSessionIdNoVary()
Returns the session id in the HTTP request.
|
java.lang.String |
getRequestURI()
Returns the URI for the request
|
java.lang.StringBuffer |
getRequestURL()
Returns the URL for the request
|
HttpServletResponseImpl |
getResponse() |
protected java.lang.String |
getRunAs() |
java.lang.String |
getScheme()
Returns the request scheme, e.g.
|
ServletService |
getServer() |
java.lang.String |
getServerName()
Returns the server name handling the request.
|
int |
getServerPort()
Returns the server port used by the client, e.g.
|
ServletContext |
getServletContext()
Returns the servlet context for the request
|
java.lang.String |
getServletName()
Returns the servlet name.
|
java.lang.String |
getServletPath()
Returns the portion of the uri mapped to the servlet for the original
request.
|
ServletResponse |
getServletResponse()
Returns the servlet response for the request
|
java.lang.String |
getSessionId() |
long |
getStartTime() |
ReadStream |
getStream() |
ReadStream |
getStream(boolean isFlush) |
boolean |
getVaryCookies()
Returns true if the page depends on cookies.
|
WebApp |
getWebApp()
Returns the invocation's webApp.
|
boolean |
hasRequest() |
boolean |
isAsyncStarted()
Returns true if the request is in async.
|
boolean |
isAsyncSupported()
Returns true if the request supports async
|
boolean |
isClosed() |
boolean |
isComet() |
boolean |
isConnectionClosed() |
boolean |
isDuplex() |
boolean |
isLoginRequested()
Returns true if any authentication is requested
|
boolean |
isRequestedSessionIdFromCookie()
Returns true if the current sessionId came from a cookie.
|
boolean |
isRequestedSessionIdFromUrl()
Deprecated.
|
boolean |
isRequestedSessionIdFromURL()
Returns true if the current sessionId came from the url.
|
boolean |
isSecure()
Returns true if the connection is secure, e.g.
|
boolean |
isSessionIdFromCookie() |
boolean |
isSuspend() |
boolean |
isSyntheticCacheHeader() |
boolean |
isTop() |
void |
killKeepalive(java.lang.String reason) |
void |
logout()
Logs out the principal.
|
void |
logoutUserPrincipal()
Clear the principal from the request object.
|
void |
removeAttribute(java.lang.String name)
Removes the value of the named request attribute.
|
void |
requestLogin() |
java.lang.String |
runAs(java.lang.String role)
Sets the overriding role.
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets the value of the named request attribute.
|
void |
setCharacterEncoding(java.lang.String encoding)
Overrides the character encoding specified in the request.
|
void |
setHasCookie()
Set when the page actually has a cookie.
|
void |
setHeader(java.lang.String key,
java.lang.String value) |
void |
setInvocation(Invocation invocation) |
void |
setSecure(java.lang.Boolean isSecure) |
void |
setSessionId(java.lang.String sessionId) |
void |
setSyntheticCacheHeader(boolean isSynthetic) |
void |
setVaryCookie(java.lang.String cookie)
Called if the page depends on a cookie.
|
AsyncContext |
startAsync()
Starts an async mode
|
AsyncContext |
startAsync(ServletRequest request,
ServletResponse response)
Starts an async mode
|
WebSocketContext |
startWebSocket(WebSocketListener listener)
Upgrade the current HTTP connection to a WebSocket connection
|
java.lang.String |
toString() |
authenticate, getLoadedSession, getMemorySession, getParameter, getParameterImpl, getParameterMap, getParameterMapImpl, getParameterNames, getParameterNamesImpl, getParameterValues, getParameterValuesImpl, getPart, getParts, getRequest, getSession, getSession, getSessionCookie, getSessionGroup, getSessionManager, getSocketLink, getUserPrincipal, isMultipartEnabled, isRequestedSessionIdValid, isUserInRole, login, login, mergeParameters, parseGetQueryImpl, parsePostQueryImpl, parseQueryImpl, startRequestclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetMemorySession, getSocketLink, isMultipartEnabled, loginauthenticate, getPart, getParts, getSession, getSession, getUserPrincipal, isRequestedSessionIdValid, isUserInRole, logingetParameter, getParameterMap, getParameterNames, getParameterValuespublic HttpServletRequestImpl(AbstractHttpRequest request)
request - public HttpServletResponseImpl getResponse()
getResponse in class AbstractCauchoRequestpublic java.lang.String getProtocol()
getProtocol in interface ServletRequestpublic java.lang.String getScheme()
getScheme in interface ServletRequestpublic java.lang.String getServerName()
getServerName in interface ServletRequestpublic int getServerPort()
isSecure() is provided for
that purpose.getServerPort in interface ServletRequestpublic java.lang.String getRemoteAddr()
getRemoteAddr in interface ServletRequestpublic java.lang.String getRemoteHost()
getRemoteHost in interface ServletRequestpublic int getRemotePort()
getRemotePort in interface ServletRequestpublic java.lang.String getLocalAddr()
getLocalAddr in interface ServletRequestpublic java.lang.String getLocalName()
getLocalName in interface ServletRequestpublic int getLocalPort()
isSecure() is provided for that purpose.getLocalPort in interface ServletRequestpublic void setCharacterEncoding(java.lang.String encoding)
throws java.io.UnsupportedEncodingException
setCharacterEncoding must be called before calling
getReader or reading any parameters.setCharacterEncoding in interface ServletRequestjava.io.UnsupportedEncodingExceptionpublic ServletInputStream getInputStream() throws java.io.IOException
getInputStream in interface ServletRequestjava.io.IOExceptionpublic java.io.BufferedReader getReader()
throws java.io.IOException,
java.lang.IllegalStateException
getCharacterEncoding()getReader in interface ServletRequestjava.io.IOExceptionjava.lang.IllegalStateExceptionpublic java.lang.String getCharacterEncoding()
getCharacterEncoding in interface ServletRequestpublic int getContentLength()
The upshot is, rely on the input stream to end when the data completes.
getContentLength in interface ServletRequestpublic java.lang.String getContentType()
getContentType in interface ServletRequestpublic java.util.Locale getLocale()
getLocale in interface ServletRequestpublic java.util.Enumeration<java.util.Locale> getLocales()
getLocales in interface ServletRequestpublic boolean isSecure()
isSecure in interface ServletRequestpublic java.lang.Object getAttribute(java.lang.String name)
getAttribute in interface ServletRequestname - the attribute name.public java.util.Enumeration<java.lang.String> getAttributeNames()
getAttributeNames in interface ServletRequestpublic void setAttribute(java.lang.String name,
java.lang.Object value)
setAttribute in interface ServletRequestname - the attribute name.value - the new attribute value.public void removeAttribute(java.lang.String name)
removeAttribute in interface ServletRequestname - the attribute name.public RequestDispatcher getRequestDispatcher(java.lang.String path)
uri
is relative to the request URI. Absolute URIs are relative to
the application prefix (getContextPath()).
If getRequestURI() is /myapp/dir/test.jsp and the
uri is "inc.jsp", the resulting page is
/myapp/dir/inc.jsp.
RequestDispatcher disp;
disp = getRequestDispatcher("inc.jsp?a=b");
disp.include(request, response);
getRequestDispatcher in interface ServletRequestgetRequestDispatcher in class AbstractCauchoRequestpath - path relative to getRequestURI()
(including query string) for the included file.public ServletContext getServletContext()
getServletContext in interface ServletRequestpublic ServletResponse getServletResponse()
getServletResponse in interface CauchoRequestpublic java.lang.String getMethod()
REQUEST_METHODgetMethod in interface HttpServletRequestpublic java.lang.String getRequestURI()
getRequestURI in interface HttpServletRequestpublic java.lang.String getPageURI()
getPageURI in interface CauchoRequestpublic java.lang.String getContextPath()
getContextPath in interface HttpServletRequestpublic java.lang.String getPageContextPath()
getPageContextPath in interface CauchoRequestpublic java.lang.String getServletPath()
getServletPath in interface HttpServletRequestpublic java.lang.String getPageServletPath()
getPageServletPath in interface CauchoRequestpublic java.lang.String getPathInfo()
getPathInfo in interface HttpServletRequestpublic java.lang.String getPagePathInfo()
getPagePathInfo in interface CauchoRequestpublic java.lang.StringBuffer getRequestURL()
getRequestURL in interface HttpServletRequestgetRequestURL in class AbstractCauchoRequestpublic java.lang.String getRealPath(java.lang.String path)
ServletRequestgetRealPath in interface ServletRequestgetRealPath in class AbstractCauchoRequestpublic java.lang.String getPathTranslated()
getPathTranslated in interface HttpServletRequestgetPathTranslated in class AbstractCauchoRequestpublic java.lang.String getQueryString()
getQueryString in interface HttpServletRequestpublic java.lang.String getPageQueryString()
getPageQueryString in interface CauchoRequestpublic java.lang.String getHeader(java.lang.String name)
HTTP_*
String userAgent = request.getHeader("User-Agent");
getHeader in interface HttpServletRequestname - the header namepublic java.util.Enumeration<java.lang.String> getHeaders(java.lang.String name)
getHeaders in interface HttpServletRequestname - the header namepublic java.util.Enumeration<java.lang.String> getHeaderNames()
getHeaderNames in interface HttpServletRequestpublic int getIntHeader(java.lang.String name)
getIntHeader in interface HttpServletRequestname - the header namepublic long getDateHeader(java.lang.String name)
long mod = request.getDateHeader("If-Modified-Since");
getDateHeader in interface HttpServletRequestname - the header namepublic Cookie[] getCookies()
getCookies in interface HttpServletRequestpublic Cookie getCookie(java.lang.String name)
getCookie in interface CauchoRequestpublic java.lang.String getRequestedSessionId()
getRequestedSessionId in interface HttpServletRequestprotected java.lang.String findSessionIdFromCookie()
public boolean isSessionIdFromCookie()
isSessionIdFromCookie in interface CauchoRequestisSessionIdFromCookie in class AbstractCauchoRequestpublic java.lang.String getSessionId()
getSessionId in interface CauchoRequestgetSessionId in class AbstractCauchoRequestpublic void setSessionId(java.lang.String sessionId)
setSessionId in interface CauchoRequestsetSessionId in class AbstractCauchoRequestpublic boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie in interface HttpServletRequestpublic boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL in interface HttpServletRequestpublic boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl in interface HttpServletRequestpublic java.lang.String getRequestedSessionIdNoVary()
protected java.lang.String getRunAs()
getRunAs in class AbstractCauchoRequestpublic java.lang.String getAuthType()
getAuthType in interface HttpServletRequestprotected Login getLogin()
public boolean isLoginRequested()
isLoginRequested in interface CauchoRequestisLoginRequested in class AbstractCauchoRequestpublic void requestLogin()
requestLogin in interface CauchoRequestrequestLogin in class AbstractCauchoRequestpublic java.lang.String getRemoteUser()
getRemoteUser in interface HttpServletRequestpublic java.lang.String getRemoteUser(boolean create)
public void logout()
logout in interface HttpServletRequestpublic void logoutUserPrincipal()
public java.lang.String runAs(java.lang.String role)
public void setSecure(java.lang.Boolean isSecure)
public ReadStream getStream() throws java.io.IOException
getStream in interface CauchoRequestjava.io.IOExceptionpublic ReadStream getStream(boolean isFlush) throws java.io.IOException
getStream in class AbstractCauchoRequestjava.io.IOExceptionpublic int getRequestDepth(int depth)
getRequestDepth in interface CauchoRequestpublic void setHeader(java.lang.String key,
java.lang.String value)
setHeader in interface CauchoRequestpublic void setSyntheticCacheHeader(boolean isSynthetic)
setSyntheticCacheHeader in interface CauchoRequestpublic boolean isSyntheticCacheHeader()
isSyntheticCacheHeader in interface CauchoRequestpublic void setVaryCookie(java.lang.String cookie)
setVaryCookie in interface CauchoRequestcookie - the cookie the page depends on.public boolean getVaryCookies()
getVaryCookies in interface CauchoRequestpublic void setHasCookie()
setHasCookie in interface CauchoRequestpublic boolean getHasCookie()
getHasCookie in interface CauchoRequestpublic boolean isTop()
isTop in interface CauchoRequestisTop in class AbstractCauchoRequestpublic boolean isComet()
isComet in interface CauchoRequestpublic void addCloseOnExit(Path path)
addCloseOnExit in class AbstractCauchoRequestpublic boolean isDuplex()
isDuplex in interface CauchoRequestpublic void killKeepalive(java.lang.String reason)
killKeepalive in interface CauchoRequestpublic boolean isConnectionClosed()
isConnectionClosed in interface CauchoRequestpublic SocketLink getConnection()
public AbstractHttpRequest getAbstractHttpRequest()
getAbstractHttpRequest in interface CauchoRequestgetAbstractHttpRequest in class AbstractCauchoRequestpublic boolean isSuspend()
isSuspend in interface CauchoRequestpublic boolean hasRequest()
hasRequest in interface CauchoRequestpublic void setInvocation(Invocation invocation)
public Invocation getInvocation()
getInvocation in class AbstractCauchoRequestpublic long getStartTime()
public void finishInvocation()
public boolean isAsyncStarted()
isAsyncStarted in interface ServletRequestpublic boolean isAsyncSupported()
isAsyncSupported in interface ServletRequestpublic AsyncContext startAsync()
startAsync in interface ServletRequestpublic AsyncContext startAsync(ServletRequest request, ServletResponse response)
startAsync in interface ServletRequestpublic AsyncContextImpl getAsyncContext()
getAsyncContext in interface ServletRequestpublic WebSocketContext startWebSocket(WebSocketListener listener) throws java.io.IOException
WebSocketServletRequeststartWebSocket in interface WebSocketServletRequestjava.io.IOExceptionpublic DispatcherType getDispatcherType()
ServletRequestgetDispatcherType in interface ServletRequestprotected void finishRequest()
throws java.io.IOException
finishRequest in class AbstractCauchoRequestjava.io.IOExceptionpublic void cleanup()
public java.lang.String getServletName()
public final ServletService getServer()
getServer in class AbstractCauchoRequestpublic final WebApp getWebApp()
getWebApp in interface CauchoRequestpublic boolean isClosed()
public java.lang.String toString()
toString in class AbstractCauchoRequest