On 7/17/2013 10:44 AM, Marek Potociar wrote:
>
> On Jul 17, 2013, at 4:09 PM, Bill Burke <bburke_at_redhat.com> wrote:
>
>> IMO, this should be challenged (if TCK tested) as it was an oversight of the API designer.
>
> Why do you think so? The javadoc of this method seems to specifically address this use case - if there is more than one or less than one Path-annotated method with the name in the class, the method is mandated to raise the exception. This is also exactly what JAX-RS 1.1 TCK is testing.
>
>> The whole point of these path() methods was so that the uribuilder wouldn't have to know the structure of the URI it was creating.
>
> Why do you think that in the current version of the API the UriBuilder would need to know the structure of the URI?
>
Because if you used path(class, "method") and method only had a @GET
annotation, you'd get an exception. The example the user had was:
@Path("/root")
public class A {
@Path("B")
B getLocator() {...}
}
public class B {
@GET
String doit();
}
So you want to point to the operation so you can create a link. If
doit() had a @Path added to it (or removed for that matter) then the
structure of the URI would change. Follow?
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com