users@jersey.java.net

Re: Re: [Jersey] Re: Alternate to HttpRequestContext#getAcceptableMediaType

From: Imran M Yousuf <imyousuf_at_smartitengineering.com>
Date: Thu, 28 Oct 2010 08:47:46 +0600

Thanks for the info John.

/Imran

On Thu, Oct 28, 2010 at 12:21 AM, John Lister <john.lister_at_kickstone.com> wrote:
> Just be careful, when you build variant list as described in the linked
> presentation you need to call add() before build() to generate the variant
> combinations for build to return. Slightly odd syntax and caught me out the
> first time.
>
> eg:
> List<Variant> vs = Variant.mediaTypes("a/xml", "a/json").languages("en",
> "fr").build();
> becomes
> List<Variant> vs = Variant.mediaTypes("a/xml", "a/json").languages("en",
> "fr").add().build();
>
> John
>
> On 19:59, Imran M Yousuf wrote:
>>
>> On Wed, Oct 27, 2010 at 3:26 PM, Paul Sandoz<Paul.Sandoz_at_oracle.com>
>>  wrote:
>>>
>>> <snip />
>>>
>>> In that case i would recommend using the Variant support.
>>>
>>> See the JavaOne 2010 presentation for how it works:
>>>
>>>  http://blogs.sun.com/sandoz/resource/J1-2010-JAX-RS-S313265.pdf
>>>
>> Thanks a lot Paul, exactly what I was looking for.
>>
>> Regards,
>>
>> Imran
>>
>>> Paul.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>>
>>>
>>
>>
>



-- 
Imran M Yousuf
Entrepreneur & CEO
Smart IT Engineering Ltd.
25/5B, Block F, Haji Chinu Miah Road Bylane
Joint Quarter, Mohammadpur
Dhaka - 1207, Bangladesh
Email: imran_at_smartitengineering.com
Twitter: @imyousuf - http://twitter.com/imyousuf
Blog: http://imyousuf-tech.blogs.smartitengineering.com/
Mobile: +880-1711402557