Hi,
I was wondering if anyone has attempted to parse query strings that contain ampersands (&) or equals (=) in the parameter values.
At the moment we have some working code to do this but it is kind of messy and complicated. If possible we would like to make use of Java classes to do this for us. I was thinking along the lines of using some or all of:
Hashtable javax.servlet.http.HttpUtils.parseQueryString( String s)
String java.net.URLDecoder.decode( String s)
String java.net.URLEncoder.encode( String s)
Has anyone managed to implement a parser using these classes? Basically the problem is determining where to split the name/value pairs when the delimiters may be included in the values.
Just to give you an idea, try parsing the following URL
http://someserver/servlet?parm1=val&ue&parm2=val=ue
Craig