users@jersey.java.net

[Jersey] Re: Unexpected behaviour with multiple parameter annotations

From: Luis Javier de la Garza Trevino <delagarza_at_gmail.com>
Date: Mon, 13 Jun 2011 23:05:32 +0200

Thanks Jakub. I filed a bug regarding the order of the annotations
(see http://java.net/jira/browse/JERSEY-731).

Thanks for your comments on the other issue (128)... That was driving
me crazy. Bear in mind that I just started using Jersey a week ago.
Shame on me, I read the spec after writing that comment on issue 128,
my bad.

On Mon, Jun 13, 2011 at 10:35 AM, Jakub Podlesak
<jakub.podlesak_at_oracle.com> wrote:
> 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.
>>
>
>



-- 
Luis Javier de la Garza Treviño