users@jersey.java.net

[Jersey] Re: Specifying different sub-resources depending on the Content-Type?

From: Gili <cowwoc_at_bbs.darktech.org>
Date: Wed, 26 Oct 2011 07:18:58 -0700 (PDT)

Cameron Heavon-Jones wrote:
>
> How about this?
>
> @Consumes(IPHONE_TYPE)
> public IPhoneDevice getIphone(String id){
> return new IphoneDevice(id);
> }
>
> @Consumes(ANDROID_TYPE)
> public AndroidDevice getAndroid(String id){
> return new AndroidDevice(id);
> }
>
> Any @Consumes annotation on the sub-resource is not used, as this has
> already been restricted on the locator.
>
> I think i'd prefer using a path name but this would work ok.
>

Hi Cameron,

This is precisely what I want but currently it does not work. Take a look at
http://java.net/jira/browse/JERSEY-798

This is currently filed as a feature request but if you're saying this is
supposed to work (according to the specification) then perhaps it should be
changed into a bug report...?

Gili

--
View this message in context: http://jersey.576304.n2.nabble.com/Specifying-different-sub-resources-depending-on-the-Content-Type-tp6487299p6932845.html
Sent from the Jersey mailing list archive at Nabble.com.