users@jersey.java.net

Re: [Jersey] Jersey thinks _at_MatrixParam is an entity

From: Daniel Larsson <daniel.j.larsson_at_gmail.com>
Date: Thu, 1 Jan 2009 02:40:37 +0100

You can think of matrix parameters as parameters on individual path segments
in an URI, while the query parameter is a parameter on the whole URI:
http://example.com/path;p=1/to;foo=bar/resource?q=a (p and foo are matrix
parameters, q a regular query parameter)

See
http://n2.nabble.com/PathSegment-and-MatrixParam-confusion-td1572432.htmlfor
some info

On Wed, Dec 31, 2008 at 11:32 PM, Kevin Duffey <andjarnic_at_yahoo.com> wrote:

> QueryParam is a query attribute.. ?attr=value.. so it's ok to use that. I
> actually dont know what MatrixParam is, but the error you are getting is
> because a GET should not take in a body entity at all. I'll have to look up
> MatrixParam, but it seems as if that comes across like an entity body and
> Jersey is preventing that. But.. I thought a QueryParam is only a string
> value.. you have a List<List<String>> in there.. which would seem wrong to
> me as a QueryParam. I could be wrong.. I've only used it to get attr=value
> query params.
>
>
> ------------------------------
> *From:* Gili <cowwoc_at_bbs.darktech.org>
> *To:* users_at_jersey.dev.java.net
> *Sent:* Wednesday, December 31, 2008 12:07:25 PM
> *Subject:* Re: [Jersey] Jersey thinks @MatrixParam is an entity
>
>
> It turns out that if you replace @MatrixParam with @QueryParam the problem
> magically goes away. I filed a new bug report:
> https://jersey.dev.java.net/issues/show_bug.cgi?id=176
>
> Gili
>
>
> Gili wrote:
> >
> > I defined the following method:
> >
> > @GET
> > @Produces(MediaType.APPLICATION_XML)
> > public Response getRandomImages(@MatrixParam("tag")
> List<List<String>>
> > oneOfTags)
> >
> > Jersey complains: A HTTP GET method, public javax.ws<http://javax.ws.rs.core.Re>
> .rs.core.Response
> > somePackage.RandomImageResource.getRandomImages(java.util.List), should
> > not consume any entity.
> >
> > Am I doing anything wrong or does this seem like a bug to anyone else?
> >
> > Thank you,
> > Gili
> >
>
> --
> View this message in context:
> http://n2.nabble.com/Jersey-thinks-%40MatrixParam-is-an-entity-tp2097066p2097102.html
> Sent from the Jersey mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>
>