hello everyone,
I wonder if it is possible to get multiple query or template parameter
already as a collection data type. I would like to see something like
that
http://localhost:8080/user/1,2,3,4
the resource class for this would then look something like this:
@Path("user/{userid}")
public class UserResource
{
@ProduceMime("application/xml")
@GET
public ReturnValue<Consultant>
getConsultantInfos(@PathParam(userids) List<String> user)
{
...
I'd like to have a list named user which contains multiple values
("1", "2", "3" and "4").
However that is what I tried. And that is what happened:
The variable user is an arraylist which contains only one element
(which is "1,2,3,4").
I alsor tried with delimiter ";" and then the arraylist only contains
1 element ("1").
I managed to get a workaround by defining an own collection which has
a constructor with one string. This string will then be tokenized to
muluiple values.
Isn't there a nicer solution for this problem, as I want this to be
the general behaviour even for all QueryParameters.
Leif Gensert