users@jersey.java.net

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

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Mon, 25 Oct 2010 12:41:39 +0200

On Oct 22, 2010, at 5:18 PM, John Lister wrote:

> On Thu, 14 Oct 2010 @ 19:25:04, Imran M Yousuf<imyousuf_at_smartitengineering.com
> > wrote
>> I have requirement for which I will need to use a functionality such
>> as HttpRequestContext.getAcceptableMediaType; but I see that it has
>> been deprecated (SVN Commit #3121), could find the reason of
>> deprecation in Issue 382 or release note. Is it safe to use it? What
>> is the right API use for same purpose?
>
> I would imagine that the alternative is to use
> request.selectVariants().
>
> I'm not sure why it was deprecated, but I'd guess it was because
> selectVariants handles
> the quality value as well as any language specified for the type.
>

The methods are deprecated because they are no longer used, and
necessarily accurate in light of changes to what the "qs" means.

Imran, what are you using them for?


> Also speaking of selectVariants, it mentions in the docs that a vary
> header is computed and added to the response,
> although it doesn't seem to do this, from evidence or the source?
>

Oops, i forgot about this, can you log an issue?

Paul.