Interface java.servlet.http.HttpServletRequest
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface java.servlet.http.HttpServletRequest

public interface HttpServletRequest
extends Object
extends ServletRequest
This interface represents an HTTP servlet request. In the servlet's service method, cast the ServletRequest parameter to HttpServletRequest in order to access HTTP protocol specified header information for the request.

Method Index

 o getAuthType()
Returns the authentication scheme of the request, or null if none.
 o getDateHeader(String, long)
Returns the value of a date header field.
 o getHeader(int)
Returns the value of the nth header field, or null if there are fewer than n fields.
 o getHeader(String)
Returns the value of a header field, or null if not known.
 o getHeaderName(int)
Returns the name of the nth header field, or null if there are fewer than n fields.
 o getIntHeader(String, int)
Returns the value of an integer header field.
 o getMethod()
Returns the method with which the request was made.
 o getPathInfo()
Returns optional extra path information following the servlet path, but immediately preceding the query string.
 o getPathTranslated()
Returns extra path information translated to a real path.
 o getQueryString()
Returns the query string part of the servlet URI, or null if none.
 o getRemoteUser()
Returns the name of the user making this request, or null if not known.
 o getRequestPath()
Returns the part of the request URI that corresponds to the servlet path plus the optional extra path information, if any
 o getRequestURI()
Returns the request URI.
 o getServletPath()
Returns the part of the request URI that refers to the servlet being invoked.

Methods

 o getMethod
  public abstract String getMethod()
Returns the method with which the request was made. The returned value can be "GET", "HEAD", "POST", or an extension method. Same as the CGI variable REQUEST_METHOD.
 o getRequestURI
  public abstract String getRequestURI()
Returns the request URI.
 o getRequestPath
  public abstract String getRequestPath()
Returns the part of the request URI that corresponds to the servlet path plus the optional extra path information, if any
 o getServletPath
  public abstract String getServletPath()
Returns the part of the request URI that refers to the servlet being invoked. Analogous to the CGI variable SCRIPT_NAME.
 o getPathInfo
  public abstract String getPathInfo()
Returns optional extra path information following the servlet path, but immediately preceding the query string. Returns null if not specified. Same as the CGI variable PATH_INFO.
 o getPathTranslated
  public abstract String getPathTranslated()
Returns extra path information translated to a real path. Returns null if no extra path information specified. Same as the CGI variable PATH_TRANSLATED.
 o getQueryString
  public abstract String getQueryString()
Returns the query string part of the servlet URI, or null if none. Same as the CGI variable QUERY_STRING.
 o getRemoteUser
  public abstract String getRemoteUser()
Returns the name of the user making this request, or null if not known. Same as the CGI variable REMOTE_USER.
 o getAuthType
  public abstract String getAuthType()
Returns the authentication scheme of the request, or null if none. Same as the CGI variable AUTH_TYPE.
 o getHeader
  public abstract String getHeader(String name)
Returns the value of a header field, or null if not known. Same as the information passed in the CGI variables HTTP_*.
Parameters:
name - the header field name
 o getIntHeader
  public abstract int getIntHeader(String name,
                                   int def)
Returns the value of an integer header field.
Parameters:
name - the header field name
def - the integer value to return if header not found or the integer format is invalid
 o getDateHeader
  public abstract long getDateHeader(String name,
                                     long def)
Returns the value of a date header field.
Parameters:
name - the header field name
def - the date value to return if header not found or the date format is invalid
 o getHeaderName
  public abstract String getHeaderName(int n)
Returns the name of the nth header field, or null if there are fewer than n fields. This can be used to iterate through all the headers in the message.
 o getHeader
  public abstract String getHeader(int n)
Returns the value of the nth header field, or null if there are fewer than n fields. This can be used to iterate through all the headers in the message.

All Packages  Class Hierarchy  This Package  Previous  Next  Index