users@jersey.java.net

[Jersey] Re: Unexpected behaviour with multiple parameter annotations

From: Jakub Podlesak <jakub.podlesak_at_oracle.com>
Date: Mon, 13 Jun 2011 10:35:49 +0200

Please see in-line...

On 06/11/2011 10:43 PM, Luis wrote:
> A method such as the following:
>
> public String echo(@QueryParam("id") @NonJerseyAnnotation final String id) {
> return "obtained id: " + id;
> }
>
> will never pull id from the query string, because the id parameter got
> assigned UNKNOWN as Source (by the IntrospectionModeller). Changing the
> order of the annotations makes the method work as expected.

Looks like a bug in Jersey. The order of the annotations should not matter.
Could you please file a new bug report?

> I debugged the IntrospectionModeller to see what was going on. It seems that
> the last annotation present on a parameter is the one that actually gets
> considered.
>
> Is it an issue with Jersey (http://java.net/jira/browse/JERSEY-128, but
> seems fixed)? Or is there something that I'm doing wrong?

I have just commented your use-case in the bug report.
Based on the JAX-RS specification, you can not have more
than one entity parameter present in the post method,
so the use-case is invalid.

~Jakub

>
>
> -----
> --
> Luis
> --
> View this message in context: http://jersey.576304.n2.nabble.com/Unexpected-behaviour-with-multiple-parameter-annotations-tp6465963p6465963.html
> Sent from the Jersey mailing list archive at Nabble.com.
>