All Packages Class Hierarchy This Package Previous Next Index
Interface java.servlet.ServletRequest
- public interface ServletRequest
-
getAttribute(String)
- Returns an attribute of the request given the specified key name.
-
getContentLength()
- Returns the size of the request entity data, or -1 if not known.
-
getContentType()
- Returns the Internet Media Type of the request entity data, or
null if not known.
-
getInputStream()
- Returns an input stream for reading the request body.
-
getParameter(String)
- Returns the value of the specified parameter for the request.
-
getParameterNames()
- Returns an enumeration of strings representing the parameter names
for this request.
-
getProtocol()
- Returns the protocol and version of the request as a string of the
form <protocol>/<major version>.<minor version>.
-
getRealPath(String)
- Applies alias rules to the specified virtual path and returns the
corresponding real path.
-
getRemoteAddr()
- Returns the IP address of the agent that sent the request.
-
getRemoteHost()
- Returns the fully qualified host name of the agent that sent the
request.
-
getServerName()
- Returns the host name of the server that received the request.
-
getServerPort()
- Returns the port number on which this request was received.
getContentLength
public abstract int getContentLength()
- Returns the size of the request entity data, or -1 if not known.
Same as the CGI variable CONTENT_LENGTH.
getContentType
public abstract String getContentType()
- Returns the Internet Media Type of the request entity data, or
null if not known. Same as the CGI variable CONTENT_TYPE.
getProtocol
public abstract String getProtocol()
- Returns the protocol and version of the request as a string of the
form <protocol>/<major version>.<minor version>.
Same as the CGI variable SERVER_PROTOCOL.
getServerName
public abstract String getServerName()
- Returns the host name of the server that received the request.
Same as the CGI variable SERVER_NAME.
getServerPort
public abstract int getServerPort()
- Returns the port number on which this request was received.
Same as the CGI variable SERVER_PORT.
getRemoteAddr
public abstract String getRemoteAddr()
- Returns the IP address of the agent that sent the request.
Same as the CGI variable REMOTE_ADDR.
getRemoteHost
public abstract String getRemoteHost()
- Returns the fully qualified host name of the agent that sent the
request. Same as the CGI variable REMOTE_HOST.
getRealPath
public abstract String getRealPath(String path)
- Applies alias rules to the specified virtual path and returns the
corresponding real path. getRealPath("/") is the document root.
It returns null if the translation cannot be performed.
- Parameters:
- path - the path to be translated
getInputStream
public abstract ServletInputStream getInputStream() throws IOException
- Returns an input stream for reading the request body.
getParameter
public abstract String getParameter(String name)
- Returns the value of the specified parameter for the request. For
example, in an HTTP servlet this would return the value of the
specified query string parameter.
- Parameters:
- name - the parameter name
getParameterNames
public abstract Enumeration getParameterNames()
- Returns an enumeration of strings representing the parameter names
for this request.
getAttribute
public abstract Object getAttribute(String name)
- Returns an attribute of the request given the specified key name.
This allows access to request information not already provided by
the other methods in this interface. Key names beginning with
'COM.sun.*' are reserved.
- Parameters:
- name - the attribute name
- Returns:
- the value of the attribute, or null if not defined
All Packages Class Hierarchy This Package Previous Next Index