users@jsr311.java.net

Re: _at_MatrixParam

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Tue, 18 Mar 2008 11:24:43 -0700

On Mar 18, 2008, at 10:32 AM, Sergey Beryozkin wrote:
>
> > If I request a collection, than I get all?
> >
> > example:
> > http://host.org/path1;mp1=a;mp2=b/path2;mp1=c;mp1=d
> > and the resource method for path2 requests @MatrixParam("mp1")
> > than the method get the 4 values [1,2,3,4]
> >
>
> You'd get just 'd' according to the rules...
> But I'm wondering, would it make sense to actually get all the
> values ?
>
> What about HeaderParam and QueryParam ? What if we have something like
> http://host.org/path1?q=1&q=2 ? Will we get '2' for a parameter
> named 'q' ?
>
Right, we've been discussing extending the types that you can annotate
to include List, Set and SortedSet so if you wanted all values of q in
the URI above you could write:

@QueryParam("q") List<Integer> qValues

Marc.

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.