users@jersey.java.net

Re: [Jersey] _at_ImplicitProduces and priorities <was> Re: [Jersey] prioritising HTML representations in web applications when using implicit or explicit views

From: James Strachan <james.strachan_at_gmail.com>
Date: Wed, 4 Feb 2009 15:01:11 +0000

2009/2/4 Paul Sandoz <Paul.Sandoz_at_sun.com>:
>
> On Jan 28, 2009, at 11:22 AM, James Strachan wrote:
>
>> 2009/1/28 Paul Sandoz <Paul.Sandoz_at_sun.com>:
>>>
>>> On Jan 28, 2009, at 10:38 AM, James Strachan wrote:
>>>
>>>> 2009/1/28 Paul Sandoz <Paul.Sandoz_at_sun.com>:
>>>>>
>>>>> On Jan 28, 2009, at 12:47 AM, James Strachan wrote:
>>>>>
>>>>>> 2009/1/27 James Strachan <james.strachan_at_gmail.com>:
>>>>>>>
>>>>>>> Awesome stuff Paul, many thanks! Taking it for a spin now...
>>>>>>
>>>>>> It works like a charm! Great stuff Paul!
>>>>>>
>>>>>
>>>>> Great. I am still not sure about the prioritization aspect of media
>>>>> types
>>>>> declared with @ImplicitProduces, it seems a hack that might be hard to
>>>>> remove when priorities are supported, or not be of the desirable
>>>>> behavior
>>>>> for some. It would be more consistent if @ImplicitProduces has the same
>>>>> order semantics as @Produces.
>>>>
>>>> Yeah.
>>>>
>>>> I wonder if we could just add support for priorities in the MIME types
>>>> for now?
>>>
>>> For @Produces that will require more work :-) I do not have time to
>>> investigate and implement in time for the 1.0.2 release with all the
>>> other
>>> things that need to be done.
>>
>> OK :)
>>
>> Would you have time to just support the priorities/quality for
>> @ImplicitProduces for 1.02?
>
> Contrary to my pessimism i managed to fine time.
>
> This is now supported in the trunk, including comma separated values.
>
> You need to specify the priority as a quality source using the "qs"
> parameter name.
>
> For example:
>
> @Path("/")
> @Singleton
> @ImplicitProduces("text/html;qs=5")
> @XmlRootElement
> @XmlAccessorType(XmlAccessType.FIELD)
> public class Bookstore { ... }

Awesome stuff - many thanks Paul!

-- 
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://fusesource.com/