users@jersey.java.net

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

From: Herak Sen <HSen_at_vertrax.com>
Date: Mon, 23 Nov 2009 10:24:27 -0500

Hi Paul,

Should I log it is an issue?
I was also wondering how much of integration with JSR 299 has been implemented?I was trying JSR-299 interceptors and faced some problems.

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