users@jsr311.java.net

Re: Sorting accept media types

From: Stephan Koops <Stephan.Koops_at_web.de>
Date: Thu, 26 Feb 2009 19:32:49 +0100

Hi Sergey,

returning text/xml is not wrong, because it will not be in conflict with
"*/*". If the client sends
Accept : text/plain,text/xml;q=0.9, applicatio/*
then returning text/xml is wrong

best regards
   Stephan

Sergey Beryozkin schrieb:
> 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
>