Title: RE: escape characters in querystring

> However, when you retrieve the querystring from the request
> object using getQueryString(), the data is not un-escaped. 
> I could write a simple class the handle this problem,
> however, I was wondering if there is a better way, or some
> method in the request, etc, that I am missing.

While getQueryString gives you the "raw" query string, the various javax.servlet.ServletRequest.getParameter methods should give you the unescaped/decoded version.  It sounds like ServletRequest.getParameter could replace your query string parser/hashtable outright.

By the way, the JDK does provide utility methods for encoding and decoding query strings, take a look at java.net.URLEncoder and java.net.URLDecoder (http://java.sun.com/j2se/1.3/docs/api/java/net/URLEncoder.html and http://java.sun.com/j2se/1.3/docs/api/java/net/URLDecoder.html).

 - rlw

Reply via email to