users@jersey.java.net

[Jersey] Re: list query params

From: Robert DiFalco <robert.difalco_at_gmail.com>
Date: Thu, 4 Dec 2014 14:53:35 -0800

Thanks! I'd like to support both formats since both are legal. The solution
there will only work for the comma delimited form but I will play around
with it.

On Thu, Dec 4, 2014 at 2:48 PM, Joakim Tørmoen <trmjoa_at_mnemonic.no> wrote:

> Hi,
>
>
>
> I dont know if its the best solution, but you can achieve this pretty
> easily by doing something like this;
>
> http://stackoverflow.com/a/23545143
>
>
>
> Best regards
>
>
>
> *From:* Robert DiFalco [mailto:robert.difalco_at_gmail.com]
> *Sent:* 4. desember 2014 23:42
> *To:* users_at_jersey.java.net
> *Subject:* [Jersey] list query params
>
>
>
> It seems like Jersey supports list query params like this:
>
>
>
> ?id=1&id=2&id=3
>
>
>
> But not like this:
>
>
>
> ?id=1,2,3
>
>
>
> Is that true or should I be using something other than:
>
>
>
> @QueryParam("id") List ids
>
>
>
> According to the table on page 6 of
> http://tools.ietf.org/html/draft-gregorio-uritemplate-04 it seems like I
> should be able to interpret the form of "?id=1,2,3".
>
>
>
> Btw, this all came about because I wanted to remove multiple entities in a
> DELETE command and became aware that (for example) android does not allow
> sending the ids to delete in the body of DELETE. I can always require the
> form of "?id=1&id=2&id=3", Jersey seems to handle this well, but it seems
> verbose.
>
>
>
> If you have ideas other than this on bulk DELETE I'd love to hear that too.
>
>
>
> R.
>