users@jersey.java.net

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

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

If that is the case I can use a simple JSON object which is simpler than
XML:
GET /resource/genes={abc 1 def 2 ...}

I thought that maybe there is an alternative using Matrix Parameters or
something, but I am reading the docs...

Thanks.

On Wed, Feb 17, 2010 at 8:30 PM, Chris Carrier <ctcarrier_at_gmail.com> wrote:

> Can you use a request body in XML or JSON or something? For instance:
>
> <genes>
> <gene id = 1>abc</gene>
> <gene id = 2>def</gene>
> ...
> </gene>
>
> Chris
>
> On Wed, Feb 17, 2010 at 12:25 PM, Dário Abdulrehman
> <dario.rehman_at_gmail.com> wrote:
> > 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.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>