users@jersey.java.net

Re: [Jersey] PathParam not injected in case of fields jersey 1.1.4

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 23 Nov 2009 16:28:35 +0100

On Nov 23, 2009, at 4:24 PM, Herak Sen wrote:

> Hi Paul,
>
> Should I log it is an issue?

Please.


> I was also wondering how much of integration with JSR 299 has been
> implemented?

In terms of JAX-RS there is integration with Jersey deferring
instantiation to the 299 framework.


> I was trying JSR-299 interceptors and faced some problems.
>

Problems in general or specific to Jersey?

Paul.

> Thanks
> Herak
>
> -----Original Message-----
> From: Paul.Sandoz_at_Sun.COM [mailto:Paul.Sandoz_at_Sun.COM]
> Sent: Monday, November 23, 2009 10:15 AM
> To: users_at_jersey.dev.java.net
> Subject: Re: [Jersey] PathParam not injected in case of fields
> jersey 1.1.4
>
> Hi Herek,
>
> You have found a bug. The problem is the interceptor that is used to
> inject assumes that the class to inject on is always a singleton,
> which is correct for EJBs but not for managed beans.
>
> Currently investigating a fix...
>
> Paul.
>
> On Nov 23, 2009, at 3:53 PM, Herak Sen wrote:
>
>> Hi,
>>
>> If I declare the resource as managed bean then pathparams declared
>> as fields are not set.
>> It works if do not make it a managed bean or if pathparams are
>> declared as method parameters.
>>
>> @ManagedBean
>> @Path("testfp/{fp}/sub")
>> public class TankRS {
>>
>> @PathParam("fp")
>> private String fp;
>>
>> @GET
>> public String testMethoth() {
>> System.out.println(fp == null);
>> return fp;
>> }
>>
>> }
>>
>> I tried it with jersey 1.1.4 and glassfishv3 build 74.
>>
>> It used to work with jersey 1.1.3
>>
>> Herak
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>