public class HttpServletRequestImpl extends Object implements javax.servlet.http.HttpServletRequest, Holders.RequestHolder
Request
request object.
All methods are delegated to the wrapped request.Modifier and Type | Field and Description |
---|---|
protected Request |
request
The wrapped request.
|
protected HttpServletResponseImpl |
servletResponse
The corresponding servlet response
|
protected boolean |
usingInputStream
Using stream flag.
|
protected boolean |
usingReader
Using writer flag.
|
Modifier | Constructor and Description |
---|---|
protected |
HttpServletRequestImpl()
Construct a wrapper for the specified request.
|
Modifier and Type | Method and Description |
---|---|
boolean |
authenticate(javax.servlet.http.HttpServletResponse hsr) |
String |
changeSessionId() |
protected Object |
clone()
Prevent cloning the facade.
|
static HttpServletRequestImpl |
create() |
void |
disableAsyncSupport()
Disables async support for this request.
|
javax.servlet.AsyncContext |
getAsyncContext() |
Object |
getAttribute(String name) |
Enumeration<String> |
getAttributeNames() |
String |
getAuthType() |
String |
getCharacterEncoding() |
int |
getContentLength() |
long |
getContentLengthLong() |
String |
getContentType() |
protected WebappContext |
getContextImpl()
Return the underlying
WebappContext |
String |
getContextPath() |
javax.servlet.http.Cookie[] |
getCookies() |
long |
getDateHeader(String name) |
javax.servlet.DispatcherType |
getDispatcherType() |
Cookie[] |
getGrizzlyCookies() |
String |
getHeader(String name) |
Enumeration<String> |
getHeaderNames() |
Enumeration<String> |
getHeaders(String name) |
javax.servlet.http.HttpUpgradeHandler |
getHttpUpgradeHandler() |
javax.servlet.ServletInputStream |
getInputStream() |
Request |
getInternalRequest()
Returns internal Grizzly
Request associated with this Holder. |
int |
getIntHeader(String name) |
String |
getLocalAddr() |
Locale |
getLocale() |
Enumeration<Locale> |
getLocales() |
String |
getLocalName() |
int |
getLocalPort() |
String |
getMethod() |
String |
getParameter(String name) |
Map<String,String[]> |
getParameterMap() |
Enumeration<String> |
getParameterNames() |
String[] |
getParameterValues(String name) |
javax.servlet.http.Part |
getPart(String string) |
Collection<javax.servlet.http.Part> |
getParts() |
String |
getPathInfo() |
String |
getPathTranslated() |
String |
getProtocol() |
String |
getQueryString() |
BufferedReader |
getReader() |
String |
getRealPath(String path) |
String |
getRemoteAddr() |
String |
getRemoteHost() |
int |
getRemotePort() |
String |
getRemoteUser() |
Request |
getRequest() |
javax.servlet.RequestDispatcher |
getRequestDispatcher(String path) |
String |
getRequestedSessionId() |
String |
getRequestURI() |
StringBuffer |
getRequestURL() |
String |
getScheme() |
String |
getServerName() |
int |
getServerPort() |
javax.servlet.ServletContext |
getServletContext() |
String |
getServletPath() |
javax.servlet.http.HttpSession |
getSession() |
javax.servlet.http.HttpSession |
getSession(boolean create) |
Principal |
getUserPrincipal() |
void |
initialize(Request request,
HttpServletResponseImpl servletResponse,
WebappContext context) |
protected void |
initSession()
Initialize the session object if there is a valid session request
|
boolean |
isAsyncStarted() |
boolean |
isAsyncSupported() |
boolean |
isRequestedSessionIdFromCookie() |
boolean |
isRequestedSessionIdFromUrl() |
boolean |
isRequestedSessionIdFromURL() |
boolean |
isRequestedSessionIdValid() |
boolean |
isSecure() |
boolean |
isUpgrade() |
boolean |
isUserInRole(String role) |
void |
login(String string,
String string1) |
void |
logout() |
void |
removeAttribute(String name) |
void |
setAttribute(String name,
Object value) |
void |
setCharacterEncoding(String env) |
protected void |
setContextImpl(WebappContext contextImpl)
Set the underlying
WebappContext |
protected void |
setContextPath(String contextPath) |
protected void |
setPathInfo(String pathInfo) |
void |
setServletPath(String servletPath)
Programmatically set the servlet path value.
|
javax.servlet.AsyncContext |
startAsync() |
javax.servlet.AsyncContext |
startAsync(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse) |
<T extends javax.servlet.http.HttpUpgradeHandler> |
upgrade(Class<T> handlerClass)
Create an instance of
HttpUpgradeHandler for an given
class and uses it for the http protocol upgrade processing. |
protected Request request
protected HttpServletResponseImpl servletResponse
protected boolean usingInputStream
protected boolean usingReader
protected HttpServletRequestImpl()
IOException
- if an input/output error occurspublic static HttpServletRequestImpl create()
public void initialize(Request request, HttpServletResponseImpl servletResponse, WebappContext context) throws IOException
IOException
protected Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public Object getAttribute(String name)
getAttribute
in interface javax.servlet.ServletRequest
public Enumeration<String> getAttributeNames()
getAttributeNames
in interface javax.servlet.ServletRequest
public String getCharacterEncoding()
getCharacterEncoding
in interface javax.servlet.ServletRequest
public void setCharacterEncoding(String env) throws UnsupportedEncodingException
setCharacterEncoding
in interface javax.servlet.ServletRequest
UnsupportedEncodingException
public int getContentLength()
getContentLength
in interface javax.servlet.ServletRequest
public long getContentLengthLong()
getContentLengthLong
in interface javax.servlet.ServletRequest
public String getContentType()
getContentType
in interface javax.servlet.ServletRequest
public javax.servlet.ServletInputStream getInputStream() throws IOException
getInputStream
in interface javax.servlet.ServletRequest
IOException
public String getParameter(String name)
getParameter
in interface javax.servlet.ServletRequest
public Enumeration<String> getParameterNames()
getParameterNames
in interface javax.servlet.ServletRequest
public String[] getParameterValues(String name)
getParameterValues
in interface javax.servlet.ServletRequest
public Map<String,String[]> getParameterMap()
getParameterMap
in interface javax.servlet.ServletRequest
public String getProtocol()
getProtocol
in interface javax.servlet.ServletRequest
public String getScheme()
getScheme
in interface javax.servlet.ServletRequest
public String getServerName()
getServerName
in interface javax.servlet.ServletRequest
public int getServerPort()
getServerPort
in interface javax.servlet.ServletRequest
public BufferedReader getReader() throws IOException
getReader
in interface javax.servlet.ServletRequest
IOException
public String getRemoteAddr()
getRemoteAddr
in interface javax.servlet.ServletRequest
public String getRemoteHost()
getRemoteHost
in interface javax.servlet.ServletRequest
public void setAttribute(String name, Object value)
setAttribute
in interface javax.servlet.ServletRequest
public void removeAttribute(String name)
removeAttribute
in interface javax.servlet.ServletRequest
public Locale getLocale()
getLocale
in interface javax.servlet.ServletRequest
public Enumeration<Locale> getLocales()
getLocales
in interface javax.servlet.ServletRequest
public boolean isSecure()
isSecure
in interface javax.servlet.ServletRequest
public javax.servlet.RequestDispatcher getRequestDispatcher(String path)
getRequestDispatcher
in interface javax.servlet.ServletRequest
public String getRealPath(String path)
getRealPath
in interface javax.servlet.ServletRequest
public String getAuthType()
getAuthType
in interface javax.servlet.http.HttpServletRequest
public Cookie[] getGrizzlyCookies()
public long getDateHeader(String name)
getDateHeader
in interface javax.servlet.http.HttpServletRequest
public String getHeader(String name)
getHeader
in interface javax.servlet.http.HttpServletRequest
public Enumeration<String> getHeaders(String name)
getHeaders
in interface javax.servlet.http.HttpServletRequest
public Enumeration<String> getHeaderNames()
getHeaderNames
in interface javax.servlet.http.HttpServletRequest
public int getIntHeader(String name)
getIntHeader
in interface javax.servlet.http.HttpServletRequest
public String getMethod()
getMethod
in interface javax.servlet.http.HttpServletRequest
public String getPathInfo()
getPathInfo
in interface javax.servlet.http.HttpServletRequest
public String getPathTranslated()
getPathTranslated
in interface javax.servlet.http.HttpServletRequest
public String getContextPath()
getContextPath
in interface javax.servlet.http.HttpServletRequest
protected void setContextPath(String contextPath)
public String getQueryString()
getQueryString
in interface javax.servlet.http.HttpServletRequest
public String getRemoteUser()
getRemoteUser
in interface javax.servlet.http.HttpServletRequest
public boolean isUserInRole(String role)
isUserInRole
in interface javax.servlet.http.HttpServletRequest
public Principal getUserPrincipal()
getUserPrincipal
in interface javax.servlet.http.HttpServletRequest
public String getRequestedSessionId()
getRequestedSessionId
in interface javax.servlet.http.HttpServletRequest
public String getRequestURI()
getRequestURI
in interface javax.servlet.http.HttpServletRequest
public StringBuffer getRequestURL()
getRequestURL
in interface javax.servlet.http.HttpServletRequest
public String getServletPath()
getServletPath
in interface javax.servlet.http.HttpServletRequest
protected void initSession()
public javax.servlet.http.HttpSession getSession(boolean create)
getSession
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.HttpSession getSession()
getSession
in interface javax.servlet.http.HttpServletRequest
public String changeSessionId()
changeSessionId
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdValid()
isRequestedSessionIdValid
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.Cookie[] getCookies()
getCookies
in interface javax.servlet.http.HttpServletRequest
public int getRemotePort()
getRemotePort
in interface javax.servlet.ServletRequest
public String getLocalName()
getLocalName
in interface javax.servlet.ServletRequest
public String getLocalAddr()
getLocalAddr
in interface javax.servlet.ServletRequest
public int getLocalPort()
getLocalPort
in interface javax.servlet.ServletRequest
protected WebappContext getContextImpl()
WebappContext
WebappContext
protected void setContextImpl(WebappContext contextImpl)
WebappContext
contextImpl
- the underlying WebappContext
public void setServletPath(String servletPath)
servletPath
- Servlet path to set.protected void setPathInfo(String pathInfo)
public Request getRequest()
public javax.servlet.ServletContext getServletContext()
getServletContext
in interface javax.servlet.ServletRequest
public Request getInternalRequest()
Request
associated with this Holder.getInternalRequest
in interface Holders.RequestHolder
public javax.servlet.DispatcherType getDispatcherType()
getDispatcherType
in interface javax.servlet.ServletRequest
public javax.servlet.AsyncContext startAsync() throws IllegalStateException
startAsync
in interface javax.servlet.ServletRequest
IllegalStateException
public javax.servlet.AsyncContext startAsync(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse) throws IllegalStateException
startAsync
in interface javax.servlet.ServletRequest
IllegalStateException
public boolean isAsyncStarted()
isAsyncStarted
in interface javax.servlet.ServletRequest
public void disableAsyncSupport()
public boolean isAsyncSupported()
isAsyncSupported
in interface javax.servlet.ServletRequest
public javax.servlet.AsyncContext getAsyncContext()
getAsyncContext
in interface javax.servlet.ServletRequest
public <T extends javax.servlet.http.HttpUpgradeHandler> T upgrade(Class<T> handlerClass) throws IOException
HttpUpgradeHandler
for an given
class and uses it for the http protocol upgrade processing.upgrade
in interface javax.servlet.http.HttpServletRequest
handlerClass
- The ProtocolHandler
class used for the upgrade.HttpUpgradeHandler
IOException
- if an I/O error occurred during the upgradeHttpUpgradeHandler
,
WebConnection
public boolean isUpgrade()
public javax.servlet.http.HttpUpgradeHandler getHttpUpgradeHandler()
public boolean authenticate(javax.servlet.http.HttpServletResponse hsr) throws IOException, javax.servlet.ServletException
authenticate
in interface javax.servlet.http.HttpServletRequest
IOException
javax.servlet.ServletException
public void login(String string, String string1) throws javax.servlet.ServletException
login
in interface javax.servlet.http.HttpServletRequest
javax.servlet.ServletException
public void logout() throws javax.servlet.ServletException
logout
in interface javax.servlet.http.HttpServletRequest
javax.servlet.ServletException
public Collection<javax.servlet.http.Part> getParts() throws IOException, javax.servlet.ServletException
getParts
in interface javax.servlet.http.HttpServletRequest
IOException
javax.servlet.ServletException
public javax.servlet.http.Part getPart(String string) throws IOException, javax.servlet.ServletException
getPart
in interface javax.servlet.http.HttpServletRequest
IOException
javax.servlet.ServletException
Copyright © 2014 Oracle Corporation. All rights reserved.