All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javax.servlet.http.HttpUtils

java.lang.Object
   |
   +----javax.servlet.http.HttpUtils

public class HttpUtils
extends Object
A set of utility methods for http server writers.

Version:
Servlet API 2.0

Constructor Index

 o HttpUtils()
Creates a HttpUtils object, cool!

Method Index

 o getRequestURL(HttpServletRequest)
Determines which URL the client used when issuing his request.
 o parsePostData(int, ServletInputStream)
Reads the data provided by the client using the POST method, passes these on to HttpUtils.parseQueryString for further treatment, and returns the resulting Hashtable.
 o parseQueryString(String)
Turns a http QUERY_STRING that conforms to rfc1945("Hypertext Transfer Protocol -- HTTP/1.0") or rfc2068 ("Hypertext Transfer Protocol -- HTTP/1.1") into a Hashtable with key = key and as values arrays of String.

Constructors

 o HttpUtils
 public HttpUtils()
Creates a HttpUtils object, cool!

Methods

 o parseQueryString
 public static Hashtable parseQueryString(String queryString) throws IllegalArgumentException
Turns a http QUERY_STRING that conforms to rfc1945("Hypertext Transfer Protocol -- HTTP/1.0") or rfc2068 ("Hypertext Transfer Protocol -- HTTP/1.1") into a Hashtable with key = key and as values arrays of String. Implementation note: when a key or value is missing it will be represented as a zero length string.

Parameters:
queryString - The queryString to process
Returns:
a Hashtable with String keys, and array of String values.
Throws: IllegalArgumentException
If the queryString contains an error it can't handle.
 o parsePostData
 public static Hashtable parsePostData(int contentLength,
                                       ServletInputStream in) throws IllegalArgumentException
Reads the data provided by the client using the POST method, passes these on to HttpUtils.parseQueryString for further treatment, and returns the resulting Hashtable.

Returns:
a Hashtable with String keys, and array of String values.
Throws: IllegalArgumentException
If an IO error occurs or the POST data contains an error it can't handle.
 o getRequestURL
 public static StringBuffer getRequestURL(HttpServletRequest request)
Determines which URL the client used when issuing his request.

Returns:
a URL.

All Packages  Class Hierarchy  This Package  Previous  Next  Index