users@jersey.java.net

[Jersey] PathParam list parameter url

From: mauricio munoz <gmauricio.munoz_at_gmail.com>
Date: Wed, 29 Dec 2010 12:39:00 -0500

Hello all,

I want to know how do I pass a parameter as a list to a resource method. I
know that I can have a list as a PathParam, but I don't know how should I
pass the list on the url.

I want to be able to call a service like this:

@GET
@Path("/somepath/{ids}")
 public List<Long> showList(@PathParam("ids") List<Long> ids) {
        return ids;
}

It seems like my method is ok. I was trying with something like
/myresource/somepath/1,2,3,4
expecting to get the {1,2,3,4} list but it didn't work.

Any help would be greatly appreciated.

-- 
Germán Mauricio Muñoz