|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.http.HttpUtils
public class HttpUtils
A set of utility methods for http server writers.
Constructor Summary | |
---|---|
HttpUtils()
Creates a HttpUtils object, cool! |
Method Summary | |
---|---|
static java.lang.StringBuffer |
getRequestURL(HttpServletRequest request)
Determines which URL the client used when issuing his request. |
static java.util.Hashtable |
parsePostData(int contentLength,
ServletInputStream in)
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. |
static java.util.Hashtable |
parseQueryString(java.lang.String queryString)
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpUtils()
Method Detail |
---|
public static java.util.Hashtable parseQueryString(java.lang.String queryString) throws java.lang.IllegalArgumentException
Results:
?a=b : key = "a", value = "b"
?a : key = "a", value = ""
?=b : key = "", value = "b"
queryString
- The queryString to process
java.lang.IllegalArgumentException
- If the queryString contains
an error it can't handle.public static java.util.Hashtable parsePostData(int contentLength, ServletInputStream in) throws java.lang.IllegalArgumentException
bonus:
When contentLength < 0 it keeps on reading data until EOF
throws an IllegalArgumentException when contentLength != amount of data in the inputstream
java.lang.IllegalArgumentException
- If an IO error occurs or
the POST data contains an error it can't handle.public static java.lang.StringBuffer getRequestURL(HttpServletRequest request)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |