users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: Injecting JAX-RS parameters via setters

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Thu, 13 Feb 2014 16:50:08 +0000

Hi Bill,
On 13/02/14 15:56, Bill Burke wrote:
>
>
> On 2/13/2014 9:42 AM, Sergey Beryozkin wrote:
>> Hi,
>>
>> I've got a question related to BeanParam but I think it has a wider
>> scope.
>>
>> Suppose we a have a per-request resource,
>>
>> public class Resource {
>>
>> @QueryParam("the_id")
>> public void setId(String id) {...}
>>
>> }
>>
>> Right now CXF expects that the property name, translated to the
>> lower-case, should match to the HTTP parameter name, in this case we
>> have "the_id" vs "id", no match, no injection
>>
>> Is it correct ?
>>
>
> No. There is no correlation between the property name and the
> @QueryParam annotation. Same goes for method params.
Right, no problems with the method parameter names, but somehow I got it
assuming the injection via the setters has different rules, not sure why
now; but either way, I see no issues with the looser binding between the
JAX-RS parameter names and the property names derived from the setters

Thanks, Sergey