Name
HttpUtils
Synopsis
Class Name: javax.servlet.http.HttpUtils
Superclass: java.lang.Object
Immediate Subclasses: None
Interfaces Implemented: None
Availability: Servlet API 1.0 and later
Description
A container object for a handful of potentially useful HTTP-oriented methods.
Class Summary
public class HttpUtils {
// Constructors
public HttpUtils();
// Class methods
public static StringBuffer getRequestURL(HttpServletRequest req);
public static Hashtable parsePostData(int len, ServletInputStream in);
public static Hashtable parseQueryString(String s);
}Constructors
HttpUtils()
public HttpUtils()
- Description
The default constructor does nothing.
Class Methods
getRequestURL()
public static StringBuffer getRequestURL(HttpServletRequest req)
- Description
Reconstitutes the request URL based on information available in the
HttpServletRequestobject. Returns aStringBufferthat includes the scheme, server name, server port, and extra path information, but not the query string. The reconstituted URL should look almost identical to the URL used by the client. This method can be used for error reporting, redirecting, and URL creation. For applications that need to uniquely identify particular servlets, thegetRequestURI( )method ofHttpServletRequestis generally a better choice.
parsePostData()
public static Hashtable parsePostData(int len, ServletInputStream in)
- Description
Parses
lencharacters of parameter data from aServletInputStream(usually sent as part of a POST operation). Throws anIllegalArgumentException ...