jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] Re: [jax-rs-spec users] Link.fromResource(Class<?> resource, String rel)

From: Jan Algermissen <jan.algermissen_at_nordsc.com>
Date: Thu, 18 Oct 2012 16:44:08 +0200

On Oct 18, 2012, at 3:57 PM, Santiago Pericas-Geertsen wrote:

> Jan,
>
> You often have a different rel value for each resource method in a resource class (for example one with @GET and another with @PUT).

Erm - what do you mean? I choose the rel value when I construct the link. It has nothing to do whatsoever with the target resource.

Or am I misreading you?

> The use of
>
> Link.Builder.fromResourceMethod(Class<?> resource, String method, String rel)
>
> does imply that the method must have an @Path annotation on it, so the @Path of the resource class will be used. Does this answer your questions?

Sort of, but not really. I do not want to be forced to have @Path on my methods to use Link support. I prefer the annotation on the class only.

Should I not get a chance to choose?

Jan

>
> -- Santiago
>
> On Oct 17, 2012, at 2:13 PM, Jan Algermissen wrote:
>
>> Hi,
>>
>> what about adding
>>
>>
>> fromResource(Class<?> resource, String rel)
>>
>> to Link?
>>
>> It is IMHO not uncommon to have resource classes without sub resource methods.
>>
>> As it stands, there seems to be no way to use Link.fromXX to 'point' to such resource classes?
>>
>> Is that intentional? By accident? or am I missing something?
>>
>> Jan
>