Name
HttpUtils
Synopsis
The HttpUtils
class contains three static methods that perform useful HTTP-related tasks. getRequestURL()
forms a functional approximation of the original request URL, including scheme, server name, server port, extra path information, and query string, based on an HttpServletRequest
object. The parsePostData()
and parseQueryString()
methods parse URL-encoded form variables from an InputStream
or a String
. In most cases, a servlet should use the getParameter()
, getParameterValues()
, and getParameterNames()
methods of HttpServletRequest
instead.
public class HttpUtils { // Public Constructors public HttpUtils(); // Public Class Methods public static StringBuffer getRequestURL( HttpServletRequest req); public static java.util.Hashtable parsePostData(int len, ServletInputStream in); public static java.util.Hashtable parseQueryString( String s); }
Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.