public class Request extends Object implements javax.servlet.http.HttpServletRequest
Modifier and Type | Class and Description |
---|---|
class |
Request.AsyncContextImpl |
class |
Request.AsyncListenerRegistration |
Modifier and Type | Field and Description |
---|---|
protected javax.servlet.ServletInputStream |
applicationInputStream
Application input stream.
|
protected BufferedReader |
applicationReader
Application reader.
|
protected Request.AsyncContextImpl |
asyncContext
Servlet 3.0 asynchronous mode context (also used as a flag - when not null,
we're in asynchronous mode).
|
protected LinkedList<javax.servlet.AsyncListener> |
asyncListenerInstances
Async listener instances.
|
protected LinkedHashMap<javax.servlet.AsyncListener,Request.AsyncListenerRegistration> |
asyncListeners
Async listeners.
|
protected long |
asyncTimeout
Async timeout.
|
protected HashMap |
attributes
The attributes associated with this Request, keyed by attribute name.
|
protected String |
authType
Authentication type.
|
protected static int |
CACHED_POST_LEN
Post data buffer.
|
protected boolean |
canStartAsync
Can call startAsync.
|
protected static boolean |
CHECK_ASYNC |
protected Connector |
connector
Associated Catalina connector.
|
protected Context |
context
Associated context.
|
protected javax.servlet.http.Cookie[] |
cookies
The set of cookies associated with this Request.
|
protected boolean |
cookiesParsed
Cookies parsed flag.
|
protected Request |
coyoteRequest
Coyote request.
|
protected int |
currentFilterChain
Number of filter chains used.
|
protected static Locale |
defaultLocale
The default Locale if none are specified.
|
protected Object |
dispatcherType
The current dispatcher type.
|
protected HttpEventImpl |
event
Associated event.
|
protected boolean |
eventMode
Event mode flag
|
protected RequestFacade |
facade
The facade associated with this request.
|
protected ArrayList<ApplicationFilterChain> |
filterChains
Filter chains associated with the request.
|
protected SimpleDateFormat[] |
formats
The set of SimpleDateFormat formats to use in getDateHeader().
|
protected static TimeZone |
GMT_ZONE |
protected static String |
info
Descriptive information about this Request implementation.
|
protected InputBuffer |
inputBuffer
The associated input buffer.
|
protected CoyoteInputStream |
inputStream
ServletInputStream.
|
protected static boolean |
LOCAL_RANDOM |
protected String |
localAddr
Local address
|
protected ArrayList |
locales
The preferred Locales assocaited with this Request.
|
protected boolean |
localesParsed
Parse locales.
|
protected String |
localName
Local address
|
protected int |
localPort
Local port
|
protected MappingData |
mappingData
Mapping data.
|
protected ParameterMap |
parameterMap
Hash map used in the getParametersMap method.
|
protected boolean |
parametersParsed
Request parameters parsed flag.
|
protected Map<String,javax.servlet.http.Part> |
parts
Parts associated with the request.
|
protected byte[] |
postData |
protected Random |
random
Random generator.
|
protected CoyoteReader |
reader
Reader.
|
protected String |
remoteAddr
Remote address.
|
protected String |
remoteHost
Remote host.
|
protected int |
remotePort
Remote port
|
protected Object |
requestDispatcherPath
The current request dispatcher path.
|
protected boolean |
requestedSessionCookie
Was the requested session ID received in a cookie?
|
protected String |
requestedSessionId
The requested session ID (if any) for this request.
|
protected boolean |
requestedSessionURL
Was the requested session ID received in a URL?
|
protected Response |
response
The response with which this request is associated.
|
protected boolean |
secure
Secure flag.
|
protected static boolean |
SEED_WITH_NEXT_BYTES |
protected Session |
session
The currently active session for this request.
|
protected static boolean |
SESSION_ID_CHECK |
protected boolean |
sessionParsed
Session parsed flag.
|
protected boolean |
sslAttributes
Get SSL attributes.
|
protected Subject |
subject
The Subject associated with the current AccessControllerContext
|
protected static boolean |
THROW_POST_TOO_LARGE |
protected HttpUpgradeHandler |
upgradeHandler
Upgrade handler.
|
protected B2CConverter |
URIConverter
URI byte to char converter (not recycled).
|
protected static boolean |
USE_PRINCIPAL_FROM_SESSION |
protected Principal |
userPrincipal
User principal.
|
protected boolean |
usingInputStream
Using stream flag.
|
protected boolean |
usingReader
Using writer flag.
|
protected static boolean |
WRAPPED_RESPONSE_IN_LOGIN |
protected Wrapper |
wrapper
Associated wrapper.
|
Constructor and Description |
---|
Request() |
Modifier and Type | Method and Description |
---|---|
void |
addCookie(javax.servlet.http.Cookie cookie)
Add a Cookie to the set of Cookies associated with this Request.
|
void |
addHeader(String name,
String value)
Add a Header to the set of Headers associated with this Request.
|
void |
addLocale(Locale locale)
Add a Locale to the set of preferred Locales for this Request.
|
void |
addParameter(String name,
String[] values)
Add a parameter name and corresponding set of values to this Request.
|
boolean |
authenticate(javax.servlet.http.HttpServletResponse response) |
void |
changeSessionId(String newSessionId)
Change the ID of the session that this request is associated with.
|
void |
clearCookies()
Clear the collection of Cookies associated with this Request.
|
void |
clearEncoders()
Clear cached encoders (to save memory for event or async requests).
|
void |
clearHeaders()
Clear the collection of Headers associated with this Request.
|
void |
clearInputStream()
Clear output stream.
|
void |
clearLocales()
Clear the collection of Locales associated with this Request.
|
protected void |
configureSessionCookie(javax.servlet.http.Cookie cookie)
Configures the given JSESSIONID cookie.
|
javax.servlet.ServletInputStream |
createInputStream()
Create and return a ServletInputStream to read the content
associated with this Request.
|
protected Session |
doGetSession(boolean create) |
protected Principal |
doGetUserPrincipal()
Return the principal that has been authenticated for this Request.
|
void |
finishRequest()
Perform whatever actions are required to flush and close the input
stream or reader, in a single operation.
|
javax.servlet.AsyncContext |
getAsyncContext() |
Object |
getAttribute(String name)
Return the specified request attribute if it exists; otherwise, return
null . |
Enumeration |
getAttributeNames()
Return the names of all request attributes for this Request, or an
empty
Enumeration if there are none. |
String |
getAuthType()
Return the authentication type used for this Request.
|
boolean |
getCanStartAsync() |
X509Certificate[] |
getCertificateChain() |
String |
getCharacterEncoding()
Return the character encoding for this Request.
|
Connector |
getConnector()
Return the Connector through which this Request was received.
|
int |
getContentLength()
Return the content length for this Request.
|
long |
getContentLengthLong() |
String |
getContentType()
Return the content type for this Request.
|
Context |
getContext()
Return the Context within which this Request is being processed.
|
String |
getContextPath()
Return the portion of the request URI used to select the Context
of the Request.
|
MessageBytes |
getContextPathMB()
Get the context path.
|
javax.servlet.http.Cookie[] |
getCookies()
Return the set of Cookies received with this Request.
|
Request |
getCoyoteRequest()
Get the Coyote request.
|
long |
getDateHeader(String name)
Return the value of the specified date header, if any; otherwise
return -1.
|
String |
getDecodedRequestURI()
Get the decoded request URI.
|
MessageBytes |
getDecodedRequestURIMB()
Get the decoded request URI.
|
javax.servlet.DispatcherType |
getDispatcherType() |
HttpEventImpl |
getEvent()
Get the event associated with the request.
|
ApplicationFilterChain |
getFilterChain()
Get filter chain associated with the request.
|
String |
getHeader(String name)
Return the first value of the specified header, if any; otherwise,
return
null |
Enumeration |
getHeaderNames()
Return the names of all headers received with this request.
|
Enumeration |
getHeaders(String name)
Return all of the values of the specified header, if any; otherwise,
return an empty enumeration.
|
Host |
getHost()
Return the Host within which this Request is being processed.
|
String |
getInfo()
Return descriptive information about this Request implementation and
the corresponding version number, in the format
<description>/<version> . |
javax.servlet.ServletInputStream |
getInputStream()
Return the servlet input stream for this Request.
|
int |
getIntHeader(String name)
Return the value of the specified header as an integer, or -1 if there
is no such header for this request.
|
String |
getLocalAddr()
Returns the Internet Protocol (IP) address of the interface on
which the request was received.
|
Locale |
getLocale()
Return the preferred Locale that the client will accept content in,
based on the value for the first
Accept-Language header
that was encountered. |
Enumeration |
getLocales()
Return the set of preferred Locales that the client will accept
content in, based on the values for any
Accept-Language
headers that were encountered. |
String |
getLocalName()
Returns the host name of the Internet Protocol (IP) interface on
which the request was received.
|
int |
getLocalPort()
Returns the Internet Protocol (IP) port number of the interface
on which the request was received.
|
MappingData |
getMappingData()
Return mapping data.
|
String |
getMethod()
Return the HTTP request method used in this Request.
|
Object |
getNote(String name)
Return the object bound with the specified name to the internal notes
for this request, or
null if no such binding exists. |
Iterator |
getNoteNames()
Return an Iterator containing the String names of all notes bindings
that exist for this request.
|
String |
getParameter(String name)
Return the value of the specified request parameter, if any; otherwise,
return
null . |
Map |
getParameterMap()
Returns a
Map of the parameters of this request. |
Enumeration |
getParameterNames()
Return the names of all defined request parameters for this request.
|
String[] |
getParameterValues(String name)
Return the defined values for the specified request parameter, if any;
otherwise, return
null . |
javax.servlet.http.Part |
getPart(String name) |
Collection<javax.servlet.http.Part> |
getParts() |
String |
getPathInfo()
Return the path information associated with this Request.
|
MessageBytes |
getPathInfoMB()
Get the path info.
|
String |
getPathTranslated()
Return the extra path information for this request, translated
to a real path.
|
Principal |
getPrincipal()
Return the principal that has been authenticated for this Request.
|
String |
getProtocol()
Return the protocol and version used to make this Request.
|
String |
getQueryString()
Return the query string associated with this request.
|
Random |
getRandom()
Return the Random.
|
BufferedReader |
getReader()
Read the Reader wrapping the input stream for this Request.
|
ReadListener |
getReadListener() |
String |
getRealPath(String path)
Deprecated.
As of version 2.1 of the Java Servlet API, use
ServletContext.getRealPath() . |
String |
getRemoteAddr()
Return the remote IP address making this Request.
|
String |
getRemoteHost()
Return the remote host name making this Request.
|
int |
getRemotePort()
Returns the Internet Protocol (IP) source port of the client
or last proxy that sent the request.
|
String |
getRemoteUser()
Return the name of the remote user that has been authenticated
for this Request.
|
javax.servlet.http.HttpServletRequest |
getRequest()
Return the
ServletRequest for which this object
is the facade. |
javax.servlet.RequestDispatcher |
getRequestDispatcher(String path)
Return a RequestDispatcher that wraps the resource at the specified
path, which may be interpreted as relative to the current request path.
|
String |
getRequestedSessionId()
Return the session identifier included in this request, if any.
|
javax.servlet.http.HttpServletRequest |
getRequestFacade()
Alias for AsyncContext inner class.
|
MessageBytes |
getRequestPathMB()
Get the request path.
|
String |
getRequestURI()
Return the request URI for this request.
|
StringBuffer |
getRequestURL()
Reconstructs the URL the client used to make the request.
|
Response |
getResponse()
Return the Response with which this Request is associated.
|
javax.servlet.http.HttpServletResponse |
getResponseFacade()
Alias for AsyncContext inner class.
|
String |
getScheme()
Return the scheme used to make this Request.
|
String |
getServerName()
Return the server name responding to this Request.
|
int |
getServerPort()
Return the server port responding to this Request.
|
javax.servlet.ServletContext |
getServletContext() |
javax.servlet.ServletContext |
getServletContext0() |
String |
getServletPath()
Return the portion of the request URI used to select the servlet
that will process this request.
|
MessageBytes |
getServletPathMB()
Get the servlet path.
|
javax.servlet.http.HttpSession |
getSession()
Return the session associated with this Request, creating one
if necessary.
|
javax.servlet.http.HttpSession |
getSession(boolean create)
Return the session associated with this Request, creating one
if necessary and requested.
|
Session |
getSessionInternal()
Return the session associated with this Request, creating one
if necessary.
|
Session |
getSessionInternal(boolean create)
Return the session associated with this Request, creating one
if necessary and requested.
|
InputStream |
getStream()
Return the input stream associated with this Request.
|
HttpUpgradeHandler |
getUpgradeHandler() |
protected B2CConverter |
getURIConverter()
Return the URI converter.
|
Principal |
getUserPrincipal()
Return the principal that has been authenticated for this Request.
|
Wrapper |
getWrapper()
Return the Wrapper within which this Request is being processed.
|
boolean |
hasSendfile() |
protected static boolean |
isAlpha(String value) |
boolean |
isAsyncStarted() |
boolean |
isAsyncSupported() |
boolean |
isEof()
Return true if the EOF has been reached.
|
boolean |
isEventMode()
Return true if the current request is using event mode.
|
boolean |
isReadable()
Return true if bytes are available.
|
boolean |
isRequestedSessionIdFromCookie()
Return
true if the session identifier included in this
request came from a cookie. |
boolean |
isRequestedSessionIdFromUrl()
Deprecated.
As of Version 2.1 of the Java Servlet API, use
isRequestedSessionIdFromURL() instead. |
boolean |
isRequestedSessionIdFromURL()
Return
true if the session identifier included in this
request came from the request URI. |
boolean |
isRequestedSessionIdValid()
Return
true if the session identifier included in this
request identifies a valid session. |
boolean |
isSecure()
Was this request received on a secure connection?
|
boolean |
isUserInRole(String role)
Return
true if the authenticated user principal
possesses the specified role name. |
void |
login(String username,
String password) |
void |
logout() |
void |
nextFilterChain()
Set filter chain associated with the request.
|
protected void |
parseCookies()
Parse cookies.
|
protected void |
parseLocales()
Parse request locales.
|
protected void |
parseLocalesHeader(String value)
Parse accept-language header value.
|
protected void |
parseMultipart()
Parse multipart.
|
protected void |
parseParameters()
Parse request parameters.
|
int |
read()
Read bytes into the low level buffer.
|
protected byte[] |
readChunkedPostBody()
Read chunked post body.
|
protected int |
readPostBody(byte[] body,
int len)
Read post body in an array.
|
boolean |
ready()
Return true if bytes or chars are available.
|
void |
recycle()
Release all object references, and initialize instance variables, in
preparation for reuse of this object.
|
void |
releaseFilterChain()
Set filter chain associated with the request.
|
void |
removeAttribute(String name)
Remove the specified request attribute if it exists.
|
void |
removeNote(String name)
Remove any object bound to the specified name in the internal notes
for this request.
|
void |
resetBody()
Clear the collection of parameters associated with this Request.
|
void |
resume() |
void |
setAttribute(String name,
Object value)
Set the specified request attribute to the specified value.
|
void |
setAuthType(String type)
Set the authentication type used for this request, if any; otherwise
set the type to
null . |
void |
setCanStartAsync(boolean canStartAsync) |
void |
setCharacterEncoding(String enc)
Overrides the name of the character encoding used in the body of
this request.
|
void |
setConnector(Connector connector)
Set the Connector through which this Request was received.
|
void |
setContentLength(int length)
Set the content length associated with this Request.
|
void |
setContentType(String type)
Set the content type (and optionally the character encoding)
associated with this Request.
|
void |
setContext(Context context)
Set the Context within which this Request is being processed.
|
void |
setContextPath(String path)
Set the context path for this Request.
|
void |
setCookies(javax.servlet.http.Cookie[] cookies)
Set the set of cookies recieved with this Request.
|
void |
setCoyoteRequest(Request coyoteRequest)
Set the Coyote request.
|
void |
setDecodedRequestURI(String uri)
Set the decoded request URI.
|
void |
setEventMode(boolean eventMode)
Set event mode.
|
void |
setFilterChain(ApplicationFilterChain filterChain)
Set filter chain associated with the request.
|
void |
setHost(Host host)
Set the Host within which this Request is being processed.
|
void |
setInputStream(javax.servlet.ServletInputStream inputStream) |
void |
setMethod(String method)
Set the HTTP request method used for this Request.
|
void |
setNote(String name,
Object value)
Bind an object to a specified name in the internal notes associated
with this request, replacing any existing binding for this name.
|
void |
setPathInfo(String path)
Set the path information for this Request.
|
void |
setProtocol(String protocol)
Set the protocol name and version associated with this Request.
|
void |
setQueryString(String query)
Set the query string for this Request.
|
void |
setReader(BufferedReader reader)
Replaces the reader with an application provided one.
|
void |
setRemoteAddr(String remoteAddr)
Set the IP address of the remote client associated with this Request.
|
void |
setRemoteHost(String remoteHost)
Set the fully qualified name of the remote client associated with this
Request.
|
void |
setRequestedSessionCookie(boolean flag)
Set a flag indicating whether or not the requested session ID for this
request came in through a cookie.
|
void |
setRequestedSessionId(String id)
Set the requested session ID for this request.
|
void |
setRequestedSessionURL(boolean flag)
Set a flag indicating whether or not the requested session ID for this
request came in through a URL.
|
void |
setRequestURI(String uri)
Set the unparsed request URI for this Request.
|
void |
setResponse(Response response)
Set the Response with which this Request is associated.
|
void |
setScheme(String scheme)
Set the name of the scheme associated with this request.
|
void |
setSecure(boolean secure)
Set the value to be returned by
isSecure()
for this Request. |
void |
setServerName(String name)
Set the name of the server (virtual host) to process this request.
|
void |
setServerPort(int port)
Set the port number of the server to process this request.
|
void |
setServletPath(String path)
Set the servlet path for this Request.
|
void |
setTimeout(int timeout)
Set connection timeout.
|
void |
setTimeout0(int timeout) |
protected void |
setURIConverter(B2CConverter URIConverter)
Set the URI converter.
|
void |
setUserPrincipal(Principal principal)
Set the Principal who has been authenticated for this Request.
|
void |
setWrapper(Wrapper wrapper)
Set the Wrapper within which this Request is being processed.
|
javax.servlet.AsyncContext |
startAsync() |
javax.servlet.AsyncContext |
startAsync(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse) |
void |
suspend() |
String |
toString() |
protected String |
unescape(String s) |
<T extends HttpUpgradeHandler> |
upgrade(Class<T> upgradeHandlerClass) |
void |
wakeup() |
protected static final boolean SESSION_ID_CHECK
protected static final boolean WRAPPED_RESPONSE_IN_LOGIN
protected static final boolean CHECK_ASYNC
protected static final boolean USE_PRINCIPAL_FROM_SESSION
protected static final boolean LOCAL_RANDOM
protected static final boolean SEED_WITH_NEXT_BYTES
protected static final boolean THROW_POST_TOO_LARGE
protected Request coyoteRequest
protected static final TimeZone GMT_ZONE
protected javax.servlet.http.Cookie[] cookies
protected SimpleDateFormat[] formats
protected static Locale defaultLocale
protected HashMap attributes
protected ArrayList locales
protected Request.AsyncContextImpl asyncContext
protected String authType
protected long asyncTimeout
protected LinkedHashMap<javax.servlet.AsyncListener,Request.AsyncListenerRegistration> asyncListeners
protected HttpEventImpl event
protected boolean eventMode
protected Object dispatcherType
protected InputBuffer inputBuffer
protected CoyoteInputStream inputStream
protected CoyoteReader reader
protected boolean usingInputStream
protected boolean usingReader
protected javax.servlet.ServletInputStream applicationInputStream
protected BufferedReader applicationReader
protected Principal userPrincipal
protected boolean sessionParsed
protected boolean parametersParsed
protected boolean cookiesParsed
protected boolean secure
protected transient Subject subject
protected static int CACHED_POST_LEN
protected byte[] postData
protected ParameterMap parameterMap
protected Session session
protected Object requestDispatcherPath
protected boolean requestedSessionCookie
protected String requestedSessionId
protected boolean requestedSessionURL
protected boolean localesParsed
protected int localPort
protected String remoteAddr
protected String remoteHost
protected int remotePort
protected String localAddr
protected String localName
protected boolean canStartAsync
protected boolean sslAttributes
protected Random random
protected LinkedList<javax.servlet.AsyncListener> asyncListenerInstances
protected HttpUpgradeHandler upgradeHandler
protected Connector connector
protected Context context
protected ArrayList<ApplicationFilterChain> filterChains
protected int currentFilterChain
protected static final String info
protected MappingData mappingData
protected RequestFacade facade
protected Response response
protected B2CConverter URIConverter
protected Wrapper wrapper
public void setCoyoteRequest(Request coyoteRequest)
coyoteRequest
- The Coyote requestpublic Request getCoyoteRequest()
public void recycle()
public void clearInputStream()
public void clearEncoders()
public int read() throws IOException
IOException
public boolean isEof()
public boolean isReadable()
public Connector getConnector()
public void setConnector(Connector connector)
connector
- The new connectorpublic Context getContext()
public void setContext(Context context)
getContextPath()
,
and thus enables parsing of the request URI.context
- The newly associated Contextpublic Random getRandom()
public ApplicationFilterChain getFilterChain()
public void setFilterChain(ApplicationFilterChain filterChain)
filterChain
- new filter chainpublic void nextFilterChain()
filterChain
- new filter chainpublic void releaseFilterChain()
filterChain
- new filter chainpublic Host getHost()
public void setHost(Host host)
host
- The newly associated Hostpublic String getInfo()
<description>/<version>
.public MappingData getMappingData()
public javax.servlet.http.HttpServletRequest getRequest()
ServletRequest
for which this object
is the facade. This method must be implemented by a subclass.public javax.servlet.http.HttpServletRequest getRequestFacade()
public Response getResponse()
public void setResponse(Response response)
response
- The new associated responsepublic javax.servlet.http.HttpServletResponse getResponseFacade()
public InputStream getStream()
protected B2CConverter getURIConverter()
protected void setURIConverter(B2CConverter URIConverter)
URIConverter
- the new URI connverterpublic Wrapper getWrapper()
public void setWrapper(Wrapper wrapper)
wrapper
- The newly associated Wrapperpublic boolean getCanStartAsync()
public void setCanStartAsync(boolean canStartAsync)
public javax.servlet.ServletInputStream createInputStream() throws IOException
IOException
- if an input/output error occurspublic void finishRequest() throws IOException
IOException
- if an input/output error occurspublic Object getNote(String name)
null
if no such binding exists.name
- Name of the note to be returnedpublic Iterator getNoteNames()
public void removeNote(String name)
name
- Name of the note to be removedpublic void setNote(String name, Object value)
name
- Name to which the object should be boundvalue
- Object to be bound to the specified namepublic void setContentLength(int length)
length
- The new content lengthpublic void setContentType(String type)
text/html; charset=ISO-8859-4
.type
- The new content typepublic void setProtocol(String protocol)
protocol
- Protocol name and versionpublic void setRemoteAddr(String remoteAddr)
remoteAddr
- The remote IP addresspublic void setRemoteHost(String remoteHost)
remoteHost
- The remote host namepublic void setScheme(String scheme)
http
, https
, and ftp
.scheme
- The schemepublic void setSecure(boolean secure)
isSecure()
for this Request.secure
- The new isSecure valuepublic void setServerName(String name)
name
- The server namepublic void setServerPort(int port)
port
- The server portpublic Object getAttribute(String name)
null
.getAttribute
in interface javax.servlet.ServletRequest
name
- Name of the request attribute to returnpublic X509Certificate[] getCertificateChain()
public Enumeration getAttributeNames()
Enumeration
if there are none.getAttributeNames
in interface javax.servlet.ServletRequest
public String getCharacterEncoding()
getCharacterEncoding
in interface javax.servlet.ServletRequest
public int getContentLength()
getContentLength
in interface javax.servlet.ServletRequest
public String getContentType()
getContentType
in interface javax.servlet.ServletRequest
public javax.servlet.ServletInputStream getInputStream() throws IOException
createInputStream()
.getInputStream
in interface javax.servlet.ServletRequest
IllegalStateException
- if getReader()
has
already been called for this requestIOException
- if an input/output error occurspublic void setInputStream(javax.servlet.ServletInputStream inputStream)
public Locale getLocale()
Accept-Language
header
that was encountered. If the request did not specify a preferred
language, the server's default Locale is returned.getLocale
in interface javax.servlet.ServletRequest
public Enumeration getLocales()
Accept-Language
headers that were encountered. If the request did not specify a
preferred language, the server's default Locale is returned.getLocales
in interface javax.servlet.ServletRequest
public String getParameter(String name)
null
. If there is more than one value defined,
return only the first one.getParameter
in interface javax.servlet.ServletRequest
name
- Name of the desired request parameterpublic Map getParameterMap()
Map
of the parameters of this request.
Request parameters are extra information sent with the request.
For HTTP servlets, parameters are contained in the query string
or posted form data.getParameterMap
in interface javax.servlet.ServletRequest
Map
containing parameter names as keys
and parameter values as map values.public Enumeration getParameterNames()
getParameterNames
in interface javax.servlet.ServletRequest
public String[] getParameterValues(String name)
null
.getParameterValues
in interface javax.servlet.ServletRequest
name
- Name of the desired request parameterpublic String getProtocol()
getProtocol
in interface javax.servlet.ServletRequest
public BufferedReader getReader() throws IOException
BufferedReader
around the
servlet input stream returned by createInputStream()
.getReader
in interface javax.servlet.ServletRequest
IllegalStateException
- if getInputStream()
has already been called for this requestIOException
- if an input/output error occurspublic void setReader(BufferedReader reader)
reader
- public String getRealPath(String path)
ServletContext.getRealPath()
.getRealPath
in interface javax.servlet.ServletRequest
path
- Path to be translatedpublic String getRemoteAddr()
getRemoteAddr
in interface javax.servlet.ServletRequest
public String getRemoteHost()
getRemoteHost
in interface javax.servlet.ServletRequest
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
public javax.servlet.RequestDispatcher getRequestDispatcher(String path)
getRequestDispatcher
in interface javax.servlet.ServletRequest
path
- Path of the resource to be wrappedpublic 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 boolean isSecure()
isSecure
in interface javax.servlet.ServletRequest
public void removeAttribute(String name)
removeAttribute
in interface javax.servlet.ServletRequest
name
- Name of the request attribute to removepublic void setAttribute(String name, Object value)
setAttribute
in interface javax.servlet.ServletRequest
name
- Name of the request attribute to setvalue
- The associated valuepublic void setCharacterEncoding(String enc) throws UnsupportedEncodingException
getReader()
.setCharacterEncoding
in interface javax.servlet.ServletRequest
enc
- The character encoding to be usedUnsupportedEncodingException
- if the specified encoding
is not supportedpublic void addCookie(javax.servlet.http.Cookie cookie)
cookie
- The new cookiepublic void addHeader(String name, String value)
name
- The new header namevalue
- The new header valuepublic void addLocale(Locale locale)
locale
- The new preferred Localepublic void addParameter(String name, String[] values)
name
- Name of this request parametervalues
- Corresponding values for this request parameterpublic void changeSessionId(String newSessionId)
session
- The session to change the session ID forpublic void clearCookies()
public void clearHeaders()
public void clearLocales()
public void resetBody()
public void setAuthType(String type)
null
. Typical values are "BASIC",
"DIGEST", or "SSL".type
- The authentication type usedpublic void setContextPath(String path)
path
- The context pathpublic void setMethod(String method)
method
- The request methodpublic void setQueryString(String query)
query
- The query stringpublic void setPathInfo(String path)
path
- The path informationpublic void setRequestedSessionCookie(boolean flag)
flag
- The new flagpublic void setRequestedSessionId(String id)
id
- The new session idpublic void setRequestedSessionURL(boolean flag)
flag
- The new flagpublic void setRequestURI(String uri)
uri
- The request URIpublic void setDecodedRequestURI(String uri)
uri
- The decoded request URIpublic String getDecodedRequestURI()
public MessageBytes getDecodedRequestURIMB()
public void setServletPath(String path)
path
- The servlet pathpublic void setUserPrincipal(Principal principal)
getRemoteUser()
method.principal
- The user Principalpublic String getAuthType()
getAuthType
in interface javax.servlet.http.HttpServletRequest
public String getContextPath()
getContextPath
in interface javax.servlet.http.HttpServletRequest
public MessageBytes getContextPathMB()
public javax.servlet.http.Cookie[] getCookies()
getCookies
in interface javax.servlet.http.HttpServletRequest
public void setCookies(javax.servlet.http.Cookie[] cookies)
public long getDateHeader(String name)
getDateHeader
in interface javax.servlet.http.HttpServletRequest
name
- Name of the requested date headerIllegalArgumentException
- if the specified header value
cannot be converted to a datepublic String getHeader(String name)
null
getHeader
in interface javax.servlet.http.HttpServletRequest
name
- Name of the requested headerpublic Enumeration getHeaders(String name)
getHeaders
in interface javax.servlet.http.HttpServletRequest
name
- Name of the requested headerpublic Enumeration getHeaderNames()
getHeaderNames
in interface javax.servlet.http.HttpServletRequest
public int getIntHeader(String name)
getIntHeader
in interface javax.servlet.http.HttpServletRequest
name
- Name of the requested headerIllegalArgumentException
- if the specified header value
cannot be converted to an integerpublic String getMethod()
getMethod
in interface javax.servlet.http.HttpServletRequest
public String getPathInfo()
getPathInfo
in interface javax.servlet.http.HttpServletRequest
public MessageBytes getPathInfoMB()
public String getPathTranslated()
getPathTranslated
in interface javax.servlet.http.HttpServletRequest
public String getQueryString()
getQueryString
in interface javax.servlet.http.HttpServletRequest
public String getRemoteUser()
getRemoteUser
in interface javax.servlet.http.HttpServletRequest
public MessageBytes getRequestPathMB()
public String getRequestedSessionId()
getRequestedSessionId
in interface javax.servlet.http.HttpServletRequest
public String getRequestURI()
getRequestURI
in interface javax.servlet.http.HttpServletRequest
public StringBuffer getRequestURL()
Because this method returns a StringBuffer
,
not a String
, you can modify the URL easily,
for example, to append query parameters.
This method is useful for creating redirect messages and for reporting errors.
getRequestURL
in interface javax.servlet.http.HttpServletRequest
StringBuffer
object containing the
reconstructed URLpublic javax.servlet.ServletContext getServletContext()
getServletContext
in interface javax.servlet.ServletRequest
public javax.servlet.ServletContext getServletContext0()
public String getServletPath()
getServletPath
in interface javax.servlet.http.HttpServletRequest
public MessageBytes getServletPathMB()
public javax.servlet.http.HttpSession getSession()
getSession
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.HttpSession getSession(boolean create)
getSession
in interface javax.servlet.http.HttpServletRequest
create
- Create a new session if one does not existpublic boolean isRequestedSessionIdFromCookie()
true
if the session identifier included in this
request came from a cookie.isRequestedSessionIdFromCookie
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromURL()
true
if the session identifier included in this
request came from the request URI.isRequestedSessionIdFromURL
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromURL()
instead.true
if the session identifier included in this
request came from the request URI.isRequestedSessionIdFromUrl
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdValid()
true
if the session identifier included in this
request identifies a valid session.isRequestedSessionIdValid
in interface javax.servlet.http.HttpServletRequest
public boolean isUserInRole(String role)
true
if the authenticated user principal
possesses the specified role name.isUserInRole
in interface javax.servlet.http.HttpServletRequest
role
- Role name to be validatedpublic Principal getPrincipal()
public Principal getUserPrincipal()
getUserPrincipal
in interface javax.servlet.http.HttpServletRequest
protected Principal doGetUserPrincipal()
public Session getSessionInternal()
public Session getSessionInternal(boolean create)
create
- Create a new session if one does not existpublic HttpEventImpl getEvent()
public boolean isEventMode()
public void setEventMode(boolean eventMode)
public boolean ready()
public void setTimeout(int timeout)
public void setTimeout0(int timeout)
public void resume()
public void wakeup()
public void suspend()
protected Session doGetSession(boolean create)
protected void configureSessionCookie(javax.servlet.http.Cookie cookie)
cookie
- The JSESSIONID cookie to be configuredprotected void parseCookies()
protected void parseParameters()
protected byte[] readChunkedPostBody() throws IOException
IOException
protected void parseMultipart() throws IOException, javax.servlet.ServletException
IOException
javax.servlet.ServletException
protected int readPostBody(byte[] body, int len) throws IOException
IOException
protected void parseLocales()
protected void parseLocalesHeader(String value)
protected static final boolean isAlpha(String value)
public javax.servlet.AsyncContext getAsyncContext()
getAsyncContext
in interface javax.servlet.ServletRequest
public boolean isAsyncStarted()
isAsyncStarted
in interface javax.servlet.ServletRequest
public boolean isAsyncSupported()
isAsyncSupported
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 authenticate(javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
authenticate
in interface javax.servlet.http.HttpServletRequest
IOException
javax.servlet.ServletException
public void login(String username, String password) 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 javax.servlet.DispatcherType getDispatcherType()
getDispatcherType
in interface javax.servlet.ServletRequest
public javax.servlet.http.Part getPart(String name) throws IOException, javax.servlet.ServletException
getPart
in interface javax.servlet.http.HttpServletRequest
IOException
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 boolean hasSendfile()
public long getContentLengthLong()
public <T extends HttpUpgradeHandler> T upgrade(Class<T> upgradeHandlerClass) throws IOException
IOException
public HttpUpgradeHandler getUpgradeHandler()
public ReadListener getReadListener()
Copyright © 2015 JBoss by Red Hat. All rights reserved.