HttpUtils Class | |
public class HttpUtils extends Object | |
Object HttpUtils The HttpUtils provides three static methods that are useful when developing HTTP servlets. |
HttpUtils() | |
public HttpUtils() | Constructor |
Creates an HttpUtils object. Since the methods defined in this class are static, they can be called directly so the constructor is unneccessary. |
getRequestURL() | |
public static StringBuffer getRequestURL(HttpServletRequest request) | Method |
getRequestURL() returns the URL the client used to make the request as a StringBuffer object. The return value will not include the query string. A new query string can be appended to the StringBuffer object. |
parsePostData() | |
public static Hashtable parsePostData(int length, ServletInputStream in) | Method |
parsePostData() parses the form data sent to a server by way of an http POST request. The data sent by the POST method is in the form of key-value pairs. This method returns a Hashtable object containing the key-value pairs. The length parameter is the length of the input stream. The ServletInputStream parameter is the input stream that contains the data sent from the client. |
parseQueryString() | |
public static Hashtable parseQueryString(String str) | Method |
parseQueryString() parses the query string passed from the client to server and returns a Hashtable containing the key-value pairs. The query string should have the key-value pairs in the form "key=value" with each pair separated by the "&" character. |