Please browse the categories below to previous answers to questions like yours. If you do not find the answer for your particular situation, ask for help on the appropriate mailing list.
(Answer) (Category) Java Apache Project : (Category) Apache JServ 1.0 : (Category) Programming and Misc. Tidbits :
How do I properly parse a query string that I receive from the browser? I am having trrouble...
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.

[Append to This Answer]
Previous: (Answer) When I upload a new version of any servlet to the machine, all the current sessions get invalidated or erased...Is this a bug?
Next: (Answer) I have a directory within my servlets directory and things break when I try to use http://www.server.com/servlets/test/TestServlet, but when I put TestServlet directly in the servlets directory and remove the "test" from the URL, things work just fine. Is this a bug?
This document is: http://java.apache.org/faq/?file=197
[Search] [Appearance] [Show Expert Edit Commands]
This is a Faq-O-Matic 2.709.
Please browse the categories below to previous answers to questions like yours. If you do not find the answer for your particular situation, ask for help on the appropriate mailing list.