IDependOn-Set: 1
IDependOn-Set: 119
IDependOn-Set: 180
IDependOn-Set: 197
IDependOn-Set: 199
IDependOn-Set: 2
LastModifiedSecs: 928905093
Parent: 119
SequenceNumber: 2
Title: How do I properly parse a query string that I receive from the browser? I am having trrouble...
Part: 0
Author-Set: jon@working-dogs.com
HideAttributions: 1
LastModifiedSecs: 928905093
Type: html
Lines: 12
As you can see from the <em>parseQueryString</em> source
        (below), the value of each hashtable entry is an array of one or more strings. If you do
        this: <blockquote>
          <pre>Hashtable params = HttpUtils.parseQueryString(req.getQueryString()); 
String name = ((String[]) (params.get(&quot;name&quot;)))[0]; </pre>
        </blockquote>
        <p>you should attain your heart's desire. The javadoc for this function is wrong, in that
        it implies that arrays will only be used if a parameter is repeated. In my opinion, it's
        better to always return String[]s and have then be length 1 in some cases, rather than
        make people check every time whether they got an array or a single object. The string
        &quot;[Ljava.lang.String;@1dce128&quot; means &quot;an array of Strings&quot;, which
        should provide a hint as to what is going wrong.
EndPart: 0
