As you can see from the parseQueryString source
(below), the value of each hashtable entry is an array of one or more strings. If you do
this:
Hashtable params = HttpUtils.parseQueryString(req.getQueryString());
String name = ((String[]) (params.get("name")))[0];
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
"[Ljava.lang.String;@1dce128" means "an array of Strings", which
should provide a hint as to what is going wrong.
|