users@jsr311.java.net

Sorting accept media types

From: Sergey Beryozkin <sberyozk_at_progress.com>
Date: Thu, 26 Feb 2009 10:04:12 -0000

Hi

If we have

Accept : text/plain,text/xml;q=0.9, */*

and two methods with one producing text/xml and another one application/pdf then what format has to be returned ?

text/xml is more specific than */* but */* has a quality factor 1.0. JAXRS specification says a quality factor is a primary key, but in this case it does seem correct to return text/xml, is it correct ?

Another question :

Accept : application/pdf;q=0.9, text/*

text/* is more specific than */* but it's still less specifc than application/pdf. Its quality factor is 1.0 though. So is it text/xml format (given the example with 2 methods above) that has to be returned ?

Thanks, Sergey