com.go.teaservlet
Interface HttpContext.Request

Enclosing class:
HttpContext

public static interface HttpContext.Request

The Request interface provides access to the data that is passed to an HTTP servlet.

Version:
41 , 00/12/12
Author:
Reece Wilton

Method Summary
 HttpContext.Attributes getAttributes()
          Returns an Attributes object containing the request attributes.
 java.lang.String getAuthType()
          Returns the name of the authentication scheme the server uses, for example, "BASIC" or "SSL," or null if the server does not have an authentication scheme.
 java.lang.String getContextPath()
          Returns the portion of the request URI that indicates the context of the request.
 HttpContext.Cookies getCookies()
          Returns a Cookies object containing the request cookies.
 HttpContext.Headers getHeaders()
          Returns a Headers object containing the request headers.
 java.lang.String getMethod()
          Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
 HttpContext.Parameters getParameters()
          Returns a Parameters object containing the request parameters.
 java.lang.String getPathInfo()
          Returns any extra path information associated with the URL the client sent when it made this request.
 java.lang.String getProtocol()
          Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1.
 java.lang.String getQueryString()
          Returns the query string that is contained in the request URL after the path.
 java.lang.String getRemoteAddr()
          Returns the Internet Protocol (IP) address of the client that sent the request.
 java.lang.String getRemoteHost()
          Returns the fully qualified name of the client that sent the request.
 java.lang.String getRemoteUser()
          Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated.
 java.lang.String getRequestedSessionId()
          Returns the session ID specified by the client.
 java.lang.String getRequestURI()
          Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.
 java.lang.String getScheme()
          Returns the name of the scheme used to make this request, for example, http, https, or ftp.
 java.lang.String getServerName()
          Returns the host name of the server that received the request.
 int getServerPort()
          Returns the port number on which this request was received.
 java.lang.String getServletPath()
          Returns the part of this request's URL that calls the servlet.
 boolean isRequestedSessionIdValid()
          Checks whether the requested session ID is still valid.
 

Method Detail

getProtocol

public java.lang.String getProtocol()
Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1.

getScheme

public java.lang.String getScheme()
Returns the name of the scheme used to make this request, for example, http, https, or ftp.

getServerName

public java.lang.String getServerName()
Returns the host name of the server that received the request.

getServerPort

public int getServerPort()
Returns the port number on which this request was received.

getRemoteAddr

public java.lang.String getRemoteAddr()
Returns the Internet Protocol (IP) address of the client that sent the request.

getRemoteHost

public java.lang.String getRemoteHost()
Returns the fully qualified name of the client that sent the request.

getAuthType

public java.lang.String getAuthType()
Returns the name of the authentication scheme the server uses, for example, "BASIC" or "SSL," or null if the server does not have an authentication scheme.

getMethod

public java.lang.String getMethod()
Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT. The returned String is the same as the value of the CGI variable REQUEST_METHOD.

getRequestURI

public java.lang.String getRequestURI()
Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request. For example:
First line of HTTP request Returned Value
POST /some/path.html HTTP/1.1/some/path.html
GET http://foo.bar/a.html HTTP/1.0 http://foo.bar/a.html
HEAD /xyz?a=b HTTP/1.1/xyz

getContextPath

public java.lang.String getContextPath()
Returns the portion of the request URI that indicates the context of the request. The context path always comes first in a request URI. The path starts with a "/" character but does not end with a "/" character.

getServletPath

public java.lang.String getServletPath()
Returns the part of this request's URL that calls the servlet. This includes either the servlet name or a path to the servlet, but does not include any extra path information or a query string.

getPathInfo

public java.lang.String getPathInfo()
Returns any extra path information associated with the URL the client sent when it made this request. The extra path information follows the servlet path but precedes the query string. Returns null if there was no extra path information.

getQueryString

public java.lang.String getQueryString()
Returns the query string that is contained in the request URL after the path. Returns null if the URL does not have a query string.

getRemoteUser

public java.lang.String getRemoteUser()
Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated. Whether the user name is sent with each subsequent request depends on the browser and type of authentication.

getRequestedSessionId

public java.lang.String getRequestedSessionId()
Returns the session ID specified by the client. This may not be the same as the ID of the actual session in use. For example, if the request specified an old (expired) session ID and the server has started a new session, this method gets a new session with a new ID. If the request did not specify a session ID, this method returns null.

isRequestedSessionIdValid

public boolean isRequestedSessionIdValid()
Checks whether the requested session ID is still valid.

getParameters

public HttpContext.Parameters getParameters()
Returns a Parameters object containing the request parameters.

getHeaders

public HttpContext.Headers getHeaders()
Returns a Headers object containing the request headers.

getCookies

public HttpContext.Cookies getCookies()
Returns a Cookies object containing the request cookies.

getAttributes

public HttpContext.Attributes getAttributes()
Returns an Attributes object containing the request attributes.