users@jersey.java.net

Re: [Jersey] Jersey thinks _at_MatrixParam is an entity

From: Gili <cowwoc_at_bbs.darktech.org>
Date: Wed, 31 Dec 2008 14:37:23 -0800 (PST)

        You are right List<List<String>> is wrong but you'll get the same error
if you use List<String> instead (which is legal). @MatrixParam is meant
to be the same as @QueryParam. It is retrieved from the URI, not the
body entity. At this point I am fairly sure that this is a Jersey bug.

PS: You can read more about @MatrixParam here:
http://www.w3.org/DesignIssues/MatrixURIs.html

Gili

Kevin Duffey (via Nabble) 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@...
> <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2097475&i=0>>
> *To:* users@...
> <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2097475&i=1>
> *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 <http://Nabble.com>.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2097475&i=2>
> For additional commands, e-mail: users-help@...
> <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2097475&i=3>
>
>
>
>
> ------------------------------------------------------------------------
> This email is a reply to your post @
> http://n2.nabble.com/Jersey-thinks-%40MatrixParam-is-an-entity-tp2097066p2097475.html
> You can reply by email or by visting the link above.
>

-- 
View this message in context: http://n2.nabble.com/Jersey-thinks-%40MatrixParam-is-an-entity-tp2097066p2097508.html
Sent from the Jersey mailing list archive at Nabble.com.