[1.19] Controlling MediaType priorities in Variants

Martynas
 

Hi,

when building a list of variants using VariantListBuilder, is there a
way to prioritize one MediaType over the other, if they both match the
requested media type? For example:

Accept: application/xml

Variant MediaTypes: application/rdf+xml, application/xhtml+xml

I want to prioritize RDF/XML over XHTML.

There is of course the q= media type parameter which does that, but I
have only seen those used by the client.

If the server implementation would build Variants with

Variant MediaTypes: application/rdf+xml, application/xhtml+xml;q=0.5

instead, would that have the desired effect on the matching algorithm?
I.e. Request.selectVariant().

Thanks.

Martynas

Join jersey@javaee.groups.io to automatically receive all group messages.