users@jersey.java.net

[Jersey] How to pass associative data to a resource?

From: Dário Abdulrehman <dario.rehman_at_gmail.com>
Date: Wed, 17 Feb 2010 20:25:22 +0000

I would like to provide a resource that expects an associative array, for
example { abc -> 1 , def -> 2} as its input:

resource?gene=abc&id=1&gene=def&id=2...etc

The above example obviously won't work since the parameters are not
interpreted by the resource in the specified order.

How can I achieve this without resorting to hand-crafted solutions, like
providing each pair as a single value, separated by a designated token, ex:
gene_id="abc_at_1"&gene_id="def_at_2"...etc ?

Thanks.