Skip to main content

[jsr339-experts] Re: Injecting a sub-resource method path parameter into a resource field - legal or not?

  • From: Marek Potociar <marek.potociar@...>
  • To: jsr339-experts@...
  • Cc: Bill Burke <bburke@...>
  • Subject: [jsr339-experts] Re: Injecting a sub-resource method path parameter into a resource field - legal or not?
  • Date: Thu, 23 Feb 2012 19:07:30 +0100

Interesting. How do you deal with @DefaultValue ? Do you allow it for 
@PathParam?

Marek

On 02/23/2012 06:20 PM, Bill Burke wrote:
> Really depends on the lifecycle of the object.  Resteasy we barf if you try 
> to do this with a singleton, but allow it
> (and return "baz") for per-request scoped resource classes.
> 
> On 2/23/12 6:01 AM, Marek Potociar wrote:
>> Hello experts,
>>
>> we've received a bug report in Jersey about the following use case:
>>
>> @Path("foo")
>> public class FooResource {
>>      @PathParam("id") String id;
>>
>>      @GET
>>      @Path("bar/{id}")
>>      public String get() {
>>          return id;
>>      }
>> }
>>
>> My question is, given the "id" path template is defined on a sub-resource 
>> method, should the value still be injectable
>> into the resource field or not?
>>
>> IOW, with the example above, what should be a result of GET "/foo/bar/baz" 
>> request? Should it be "baz" or null ?
>>
>> Thanks,
>> Marek
> 


[jsr339-experts] Injecting a sub-resource method path parameter into a resource field - legal or not?

Marek Potociar 02/23/2012

[jsr339-experts] Re: Injecting a sub-resource method path parameter into a resource field - legal or not?

Sergey Beryozkin 02/23/2012

[jsr339-experts] Re: Injecting a sub-resource method path parameter into a resource field - legal or not?

Marek Potociar 02/23/2012

[jsr339-experts] Re: Injecting a sub-resource method path parameter into a resource field - legal or not?

Sergey Beryozkin 02/23/2012

[jsr339-experts] Re: Injecting a sub-resource method path parameter into a resource field - legal or not?

Sergey Beryozkin 02/23/2012

[jsr339-experts] Re: Injecting a sub-resource method path parameter into a resource field - legal or not?

Marek Potociar 02/23/2012

[jsr339-experts] Re: Injecting a sub-resource method path parameter into a resource field - legal or not?

Sergey Beryozkin 02/23/2012

[jsr339-experts] Re: [jax-rs-spec users] Re: Injecting a sub-resource method path parameter into a resource field - legal or not?

Santiago Pericas-Geertsen 02/24/2012

[jsr339-experts] Re: Injecting a sub-resource method path parameter into a resource field - legal or not?

Bill Burke 02/23/2012

[jsr339-experts] Re: Injecting a sub-resource method path parameter into a resource field - legal or not?

Marek Potociar 02/23/2012

[jsr339-experts] Re: Injecting a sub-resource method path parameter into a resource field - legal or not?

Bill Burke 02/23/2012
 
 
Close
loading
Please Confirm
Close