All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface java.servlet.ServletRequest

public interface ServletRequest

Method Index

 o getAttribute(String)
Returns an attribute of the request given the specified key name.
 o getContentLength()
Returns the size of the request entity data, or -1 if not known.
 o getContentType()
Returns the Internet Media Type of the request entity data, or null if not known.
 o getInputStream()
Returns an input stream for reading the request body.
 o getParameter(String)
Returns the value of the specified parameter for the request.
 o getParameterNames()
Returns an enumeration of strings representing the parameter names for this request.
 o getProtocol()
Returns the protocol and version of the request as a string of the form <protocol>/<major version>.<minor version>.
 o getRealPath(String)
Applies alias rules to the specified virtual path and returns the corresponding real path.
 o getRemoteAddr()
Returns the IP address of the agent that sent the request.
 o getRemoteHost()
Returns the fully qualified host name of the agent that sent the request.
 o getServerName()
Returns the host name of the server that received the request.
 o getServerPort()
Returns the port number on which this request was received.

Methods

 o 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.

 o 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.

 o 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.

 o getServerName
  public abstract String getServerName()
Returns the host name of the server that received the request. Same as the CGI variable SERVER_NAME.

 o getServerPort
  public abstract int getServerPort()
Returns the port number on which this request was received. Same as the CGI variable SERVER_PORT.

 o getRemoteAddr
  public abstract String getRemoteAddr()
Returns the IP address of the agent that sent the request. Same as the CGI variable REMOTE_ADDR.

 o 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.

 o 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
 o getInputStream
  public abstract ServletInputStream getInputStream() throws IOException
Returns an input stream for reading the request body.

 o 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
 o getParameterNames
  public abstract Enumeration getParameterNames()
Returns an enumeration of strings representing the parameter names for this request.

 o 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