users@jsr311.java.net

Re: When to sort Accept header values

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Wed, 04 Feb 2009 12:30:57 -0500

On Feb 4, 2009, at 11:38 AM, Sergey Beryozkin wrote:

> Hi
>
>> On Feb 4, 2009, at 11:17 AM, Sergey Beryozkin wrote:
>>>
>>> As I said clients are writing their applications against targeted
>>> applications. It's the browsers which create those uber-complex
>>> accept values. As far as ordinary clients are concerned, I'm not
>>> certain they will fare better with application/json,application/
>>> xml;q=0.8 when sending requests to some dynamic resources they
>>> didn't hear before about than with application/json,application/xml.
>>>
>
>> I'm confused now, if a client includes quality params in the
>> Accept and the resource class has methods that produce the most
>> preferred type then that will be returned. Are you saying that
>> isn't the case ?
>
> It is if it's a JAXRS server which sits on the other end.

Or any other HTTP server that supports server-driven conneg.

> My point was that if JAXRS supported ordering (well Jersey does at
> least) then it would unlikely cause 'bad' sideeffects.

I agree that the potential harm is small but isn't it better to
encourage clients to send better Accept headers ? If they have a
preferred media type they should assign it a higher quality...

> given that a client is not guaranteed to get the right format from a
> non JAXRS server, irrespectively of whether quality params are
> included or not
>
I don't understand the last statement, if the server supports serve-
driven conneg then it should respond accordingly.

Marc.

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.