users@jersey.java.net

Re: Re: [Jersey] Using _at_Produces to match Accept with WebKit advice

From: John Lister <john.lister_at_kickstone.com>
Date: Sun, 02 May 2010 21:12:56 +0100

Paul Sandoz wrote:
> Yes, that is the expected behavior as declared by the accept header
> and specified by JAX-RS.
I know, just annoying that WebKit uses such an annoying accept header -
even putting XHTML first would have been better....
>
> I am trying to think why i restricted values to be > 1 for this to
> work. It could be because using "qs=0.5" on the value results in all
> other produceable media types with no qs being higher but with no
> defined order to those media types.
>
> Could you log an issue? i think we should throw a parsing error if qs
> < 1.
Done - Issue 521
>
>> Secondly I've tried using Request.selectVariant to return the best
>> matched type from a supplied list which includes
>> application/xhtml+xml and according to the various things I've read
>> on the web as it is the most specific at the highest priority it
>> should be matched first, but again I still get xml. Looking through
>> the source, it seems that for the same priority the first type listed
>> is returned first which as I imagine it is almost impossible to know
>> which types are more specific than others there isn't much more to do.
>
> Request.selectVariant will not take into account the Jersey "qs"
> parameter (another bug, log another issue?) and will result in the
> first expected behavior.
Done as well - Issue 522
> Unfortunately not, this is an oversight in JAX-RS/Jersey. Could you
> log another issues?
Done. Issue 523


Thanks

John