atom feed6 messages in [Jersey] MultivaluedMap
FromSent OnAttachments
Ronak PatelOct 27, 2009 7:36 pm 
Paul SandozOct 27, 2009 11:44 pm 
Ronak PatelOct 28, 2009 6:41 am 
Paul SandozOct 28, 2009 7:48 am 
Ronak PatelOct 28, 2009 10:35 am 
Paul SandozOct 28, 2009 10:46 am 
Subject:Re: [Jersey] MultivaluedMap
From:Ronak Patel (
Date:Oct 28, 2009 6:41:47 am


I'm using Jersey version

I tried doing put and add with the same result. I even tried to loop through the
String array on my own and add one at a time.


________________________________ From: Paul Sandoz <Paul@Sun.COM> To: Sent: Tue, October 27, 2009 11:44:47 PM Subject: Re: [Jersey] MultivaluedMap

Hi Ronak,

What version of Jersey are you using?

I tried a quick test with 1.1.4-ea-SNAPSHOT and it worked as you expect. There
is no code to explicitly write "," in the URI builder implementation.

BTW you can also do the following which is equivalent:

resource.queryParam("id", "hello").queryParam("id",

Are you sure you did not do:

queryParams.add("id", Arrays.asList(new String[]{"hello", "there"}));


which will create query string:




I have a quite a basic question which I am embarrassed to ask but one I've been
scratching my head about...

I'm using MultivaluedMap and MultivaluedMapImpl to set my queryParams on the
JAX-RS Jersey Client API

and I don't see Jersey formulate my expected url.

I am doing as so:

Client client = Client.create(); WebResource resource = client.resource(""); MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();

queryParams.put("id", Arrays.asList(new String[]{"hello", "there"}));


Now, I don't see Jersey formulate the list of parameters as
id=hello&id=there...and instead I see id=hello,there which is not what I want.

What should I be doing to obtain a url with id=hello&id=there?