All Known Implementing Classes:
HttpServletRequest, HttpServletRequestWrapper, ServletRequestWrapper
ServletRequest
object and passes
it as an argument to the servlet's service
method.
A ServletRequest
object provides data including
parameter name and values, attributes, and an input stream.
Interfaces that extend ServletRequest
can provide
additional protocol-specific data (for example, HTTP data is
provided by javax.servlet.http.HttpServletRequest .
Various
- $
- Version$Method from javax.servlet.ServletRequest Summary: |
---|
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocalName, getLocalPort, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding |
Method from javax.servlet.ServletRequest Detail: |
---|
Object ,
or null if no attribute of the given name exists.
Attributes can be set two ways. The servlet container may set
attributes to make available custom information about a request.
For example, for requests made using HTTPS, the attribute
Attribute names should follow the same conventions as package
names. This specification reserves names matching |
Enumeration containing the
names of the attributes available to this request.
This method returns an empty Enumeration
if the request has no attributes available to it. |
null if the request
does not specify a character encoding |
|
null if the type is not known. For HTTP servlets,
same as the value of the CGI variable CONTENT_TYPE. |
|
|
|
|
Locale that the client will
accept content in, based on the Accept-Language header.
If the client request doesn't provide an Accept-Language header,
this method returns the default locale for the server. |
Enumeration of Locale objects
indicating, in decreasing order starting with the preferred locale, the
locales that are acceptable to the client based on the Accept-Language
header.
If the client request doesn't provide an Accept-Language header,
this method returns an Enumeration containing one
Locale , the default locale for the server. |
String ,
or null if the parameter does not exist. Request parameters
are extra information sent with the request. For HTTP servlets,
parameters are contained in the query string or posted form data.
You should only use this method when you are sure the parameter has only one value. If the parameter might have more than one value, use #getParameterValues . If you use this method with a multivalued
parameter, the value returned is equal to the first value
in the array returned by If the parameter data was sent in the request body, such as occurs with an HTTP POST request, then reading the body directly via #getInputStream or #getReader can interfere with the execution of this method. |
|
Enumeration of String
objects containing the names of the parameters contained
in this request. If the request has
no parameters, the method returns an
empty Enumeration . |
String objects containing
all of the values the given request parameter has, or
null if the parameter does not exist.
If the parameter has a single value, the array has a length of 1. |
SERVER_PROTOCOL . |
BufferedReader . The reader translates the character
data according to the character encoding used on the body.
Either this method or #getInputStream may be called to read the
body, not both. |
|
REMOTE_ADDR . |
REMOTE_HOST . |
|
RequestDispatcher object can be used to forward
a request to the resource or to include the resource in a response.
The resource can be dynamic or static.
The pathname specified may be relative, although it cannot extend
outside the current servlet context. If the path begins with
a "/" it is interpreted as relative to the current context root.
This method returns The difference between this method and ServletContext#getRequestDispatcher is that this method can take a relative path. |
http , https , or ftp .
Different schemes have different rules for constructing URLs,
as noted in RFC 1738. |
Host
header value, if any, or the resolved server name, or the server IP address. |
Host
header value, if any, or the server port where the client connection
was accepted on. |
|
Attribute names should follow the same conventions as
package names. Names beginning with |
Attribute names should follow the same conventions as
package names. Names beginning with |
|