users@jersey.java.net

Re: [Jersey] Default value for Set or List QueryParam when no values are given

From: Stephen Duncan Jr <stephen.duncan_at_gmail.com>
Date: Fri, 8 May 2009 15:31:30 -0400

On Fri, May 8, 2009 at 3:21 PM, Rabick, Mark A (IS) <Mark.Rabick_at_ngc.com>wrote:

> regarding collection types mapped to a @QueryParam
>
> >4. Be List<T>, Set<T> or SortedSet<T>, where T satisfies 2 or 3 above.
> The resulting collection is read-only.
>
> How is the list/set parsed from the query parameter?? does it split(',')
> or split(';') or is there some way to specify a delimiter?
>
> I can't find how List vs. Set vs. Sorted Set behave, just that they are
> valid parameters to annotate with QueryParam.
>
> -mark
>
> *_______________________________________________*
> *Mark A. Rabick* - Software Engineer
> *Em: mark.rabick_at_ngc.com*
>

From there being multiple instances in the url, like when you submit a form
with checkboxes to a GET URL:

http://example.com/foo?bar=a&bar=b&bar=c

@QueryParam("bar") Set<String> barValues would result in barValues like: [b,
c, a] (or something like that; I'm assuming a HashSet and therefore no order
involved).

-- 
Stephen Duncan Jr
www.stephenduncanjr.com