All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class WebSite.Servlet.Request

java.lang.Object
   |
   +----WebSite.Servlet.Request

public final class Request
extends Object

The Request class implements the WebSite request-related properties. It is purely a static class, it cannot be instantiated.

Request "Cookie" support provides the functionality described in the Netscape Cookie Specification and the new RFC 2109 State Management cookies.

See Also:
Client, Cookie, Form, Response, Server, Session

Method Index

 o acceptTypeCount()
Returns the number of Accept: content types in the request.
 o acceptTypeNames()
Returns an enumeration of the Accept: content types in the request.
 o containsAcceptType(String)
Returns true if the request contains the given Accept: content type.
 o containsExtraHeader(String)
Returns true if the request contains the named extra header.
 o extraHeaderCount()
Returns the number of extra headers in the request.
 o extraHeaderNames()
Returns an enumeration of the extra header names in the request.
 o getAcceptTypeQValues(String)
Returns a String containing the the "q-values" the given Accept: content type.
 o getContentLength()
Gets the length in bytes of any content that may have been supplied with the request.
 o getContentType()
Gets the media content type of any data attached to the request.
 o getCookies()
Returns a Vector of Cookie objects representing the cookies that were sent with the request.
 o getExtraHeader(String)
Gets the value of the named request extra header, or null if it is not present.
 o getFrom()
Gets the email address of the browser user.
 o getInputStream()
Gets an InputStream from which you can read the raw content supplied with the request.
 o getLogicalPath()
A request may contain "extra path" elements following the script element.
 o getMethod()
Gets the method with which the request was made.
 o getPhysicalPath()
A request may contain "extra path" elements following the script element.
 o getProtocol()
Gets the name and revision of the protocol with which the request was made.
 o getQueryString()
Gets any information which follows the '?' in the request URL, in its original encoded form.
 o getRanges()
Gets any byte-range request information that was present in the request.
 o getReferer()
Gets the URL of the document that contained the link to this servlet.
 o getScriptPath()
Gets the URL path of this script.

Methods

 o getProtocol
 public static native String getProtocol()
Gets the name and revision of the protocol with which the request was made.

Format: protocol/revision.
Example: HTTP/1.0

 o getMethod
 public static native String getMethod()
Gets the method with which the request was made. For HTTP, this is GET, POST, etc.

 o getScriptPath
 public static native String getScriptPath()
Gets the URL path of this script. May be used to construct self-referencing URLs.

See Also:
URL
 o getLogicalPath
 public static native String getLogicalPath()
A request may contain "extra path" elements following the script element. This function retrieves any such extra path information exactly as it appeared in the original URL. Returns null if no extra path information was present.

See Also:
getPhysicalPath
 o getPhysicalPath
 public static native String getPhysicalPath()
A request may contain "extra path" elements following the script element. This method retrieves any such extra path information as translated from URL to physical form. Returns null if no extra path information was present.

See Also:
getLogicalPath
 o getQueryString
 public static native String getQueryString()
Gets any information which follows the '?' in the request URL, in its original encoded form. null if no query was present.

 o getRanges
 public static native String getRanges()
Gets any byte-range request information that was present in the request. For the latest information on the status of the byte-range extension to HTTP/1.0 and the HTTP/1.1 spec, see the IETF HTTP Working Group Home Page. null if no range information was present.

 o getReferer
 public static native String getReferer()
Gets the URL of the document that contained the link to this servlet. null if no Referer: information was present. The misspelling is historical.

 o getFrom
 public static native String getFrom()
Gets the email address of the browser user. This item is included in the HTTP/1.0 specification, however for privacy reasons, it is not generally used, and should not be relied on. null if no From: information was present.

 o getContentType
 public static native String getContentType()
Gets the media content type of any data attached to the request. null if no attached content or if the attached content was (incorrectly) untyped.

Format: type/subtype
Example: multipart/form-data

 o getContentLength
 public static native int getContentLength()
Gets the length in bytes of any content that may have been supplied with the request.

 o getCookies
 public static native Vector getCookies()
Returns a Vector of Cookie objects representing the cookies that were sent with the request.

See Also:
Cookie
 o containsExtraHeader
 public static boolean containsExtraHeader(String name)
Returns true if the request contains the named extra header.

Parameters:
name - The name (label) of the extra header
 o getExtraHeader
 public static String getExtraHeader(String name)
Gets the value of the named request extra header, or null if it is not present.

Parameters:
name - The name (label) of the extra header
 o extraHeaderCount
 public static int extraHeaderCount()
Returns the number of extra headers in the request.

 o extraHeaderNames
 public static Enumeration extraHeaderNames()
Returns an enumeration of the extra header names in the request. The enumeration returns String objects that contain the header name or label of a request extra header.

 o containsAcceptType
 public static boolean containsAcceptType(String type)
Returns true if the request contains the given Accept: content type.

Parameters:
type - The Accept: content type to check for
 o getAcceptTypeQValues
 public static String getAcceptTypeQValues(String type)
Returns a String containing the the "q-values" the given Accept: content type. If there are no q-values, this will return the String "Yes".

Parameters:
type - The Accept: content type to get q-values for
 o acceptTypeCount
 public static int acceptTypeCount()
Returns the number of Accept: content types in the request.

 o acceptTypeNames
 public static Enumeration acceptTypeNames()
Returns an enumeration of the Accept: content types in the request. The enumeration returns String objects that contain the acceptable media content type for the response. To get the q values for a particular content type, use the getAcceptTypeQValues() method.

 o getInputStream
 public static InputStream getInputStream()
Gets an InputStream from which you can read the raw content supplied with the request. Each call creates a new InputStream on the HTTP content (if any). If no content was sent with the request, reading from this stream will return EOF immediately. To easily determine whether there is any content, test if Request.getContentLength() is greater than zero.


All Packages  Class Hierarchy  This Package  Previous  Next  Index