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