You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Lukas Bradley <lu...@somnia.com> on 2005/04/07 22:46:40 UTC

Translating Query String into Map and vice versa?

I thought this functionality was included in BeanUtils, but apparently 
I'm wrong.

I'm looking for methods to translate web query strings into a Map, and a 
Map of name/value pairs into a String.  Of course, I also would like the 
method to handle URLEncoding and Decoding.

It would be quick to write, but I was hoping it already existed.

Thanks for any help finding these rogue methods.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: Translating Query String into Map and vice versa?

Posted by Lukas Bradley <lu...@somnia.com>.
> Also, note that a Map is not sufficient since you could have several 
> arguments for one key.

Nice catch.  Forgot about that.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: Translating Query String into Map and vice versa?

Posted by Paul Libbrecht <pa...@activemath.org>.
I would look at this in Tomcat...

Beware, there's a catch there: URLEncoding and URLDecoding need a 
charset... browsers generally use the charset that the form was 
displayed with.

Also, note that a Map is not sufficient since you could have several 
arguments for one key.

paul


Le 7 avr. 05, à 22:46, Lukas Bradley a écrit :

> I thought this functionality was included in BeanUtils, but apparently 
> I'm wrong.
>
> I'm looking for methods to translate web query strings into a Map, and 
> a Map of name/value pairs into a String.  Of course, I also would like 
> the method to handle URLEncoding and Decoding.
>
> It would be quick to write, but I was hoping it already existed.
>
> Thanks for any help finding these rogue methods.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: Translating Query String into Map and vice versa?

Posted by José Antonio Pérez Testa <ja...@indra.es>.
Look at:
http://svn.apache.org/viewcvs.cgi/jakarta/commons/sandbox/servlet/trunk/src/java/org/apache/commons/servlet/RequestUtils.java?rev=156588&view=log

Lukas Bradley wrote:

> I thought this functionality was included in BeanUtils, but apparently 
> I'm wrong.
>
> I'm looking for methods to translate web query strings into a Map, and 
> a Map of name/value pairs into a String.  Of course, I also would like 
> the method to handle URLEncoding and Decoding.
>
> It would be quick to write, but I was hoping it already existed.
>
> Thanks for any help finding these rogue methods.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org