users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: service locators and class-level @Path

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Tue, 6 Mar 2012 12:04:29 -0500

Experts,

 I've used a modified version of the example below to explain the input/output of each step in the matching algorithm in the spec (section 3.7.2). Should help understand how the algorithm works as well as why @Path is not matched in this case. Please review.

-- Santiago
 
On Feb 20, 2012, at 2:34 PM, Bill Burke wrote:

> i have a bug from a user that I"m not sure its a bug or not because the spec isn't clear:
>
> The spec allows a service locator that has no @Path annotation on the class:
>
> public class MyLocator {
>
> @GET
> public String foo() {..}
>
>
> Now, if this class has a @Path on it, is that @Path ignored or not when matching?
>
>
> @Path("abc")
> public class MyLocator {
>
> @GET
> public String foo() {...}
> }
>
>
> @Path("/test")
> public class MyService {
>
> @Path("/locator")
> public MyLocator getLocator() {...}
>
> }
>
>
> So, to get to call teh foo() method is the path "/test/locator/abc" or /test/locator"? Is the class level @Path ignored or not?
>
>
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com