users@jersey.java.net

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

From: John Lister <john.lister_at_kickstone.com>
Date: Wed, 10 Nov 2010 15:45:20 +0000

On 19:59, Paul Sandoz wrote:
>
> On Oct 27, 2010, at 8:21 PM, John Lister 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();
>>
>
> Thanks for pointing that out, it has caught me out too! I think that
> is a bug in Jersey and potentially in 311.
>
> Would you mind logging another issue against Jersey (if the issue
> tracker is not in r/o mode)?
OK, done as can finally log into the new java.net (well mostly :)

issue 602, see
http://java.net/jira/browse/JERSEY-602

John