You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Raj Floyd <ra...@gmail.com> on 2011/09/05 13:56:52 UTC
JAX-RS spec about Resource
Hi
JAX-RS spec says:
* Resource classes are POJOs that have at least one method annotated with
@Path or a request method designator.*
I feel a Resource class should have both the annotations (@Path and method
designator) for it to be called as a Resource. If there is no request method
designator annotation like @POST or @GET, the existence of Resource does not
really make sense. Is the spec misleading or have I got it wrong? Any
thoughts?
Thanks
Raj
Re: JAX-RS spec about Resource
Posted by Raj Floyd <ra...@gmail.com>.
Thanks Sergey.
On Mon, Sep 5, 2011 at 5:35 PM, Sergey Beryozkin <sb...@gmail.com>wrote:
> Hi,
>
> On 05/09/11 12:56, Raj Floyd wrote:
>
>> Hi
>>
>> JAX-RS spec says:
>>
>> * Resource classes are POJOs that have at least one method annotated with
>> @Path or a request method designator.*
>>
>> I feel a Resource class should have both the annotations (@Path and method
>> designator) for it to be called as a Resource. If there is no request
>> method
>> designator annotation like @POST or @GET, the existence of Resource does
>> not
>> really make sense. Is the spec misleading or have I got it wrong? Any
>> thoughts?
>>
>> Some resource classes can act as subresources only, that is they may only
> contain resource methods annotated with @Path annotations. Such resource
> methods delegate the processing further to classes which will contain
> @GET/etc...
>
> Cheers, Sergey
>
> Thanks
>>
>> Raj
>>
>>
>
Re: JAX-RS spec about Resource
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi,
On 05/09/11 12:56, Raj Floyd wrote:
> Hi
>
> JAX-RS spec says:
>
> * Resource classes are POJOs that have at least one method annotated with
> @Path or a request method designator.*
>
> I feel a Resource class should have both the annotations (@Path and method
> designator) for it to be called as a Resource. If there is no request method
> designator annotation like @POST or @GET, the existence of Resource does not
> really make sense. Is the spec misleading or have I got it wrong? Any
> thoughts?
>
Some resource classes can act as subresources only, that is they may
only contain resource methods annotated with @Path annotations. Such
resource methods delegate the processing further to classes which will
contain @GET/etc...
Cheers, Sergey
> Thanks
>
> Raj
>