dev@jersey.java.net

Re: [Jersey][WebDAV] Different handling of lax=true

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 14 Jan 2009 11:49:34 +0100

On Jan 13, 2009, at 8:08 PM, Markus KARG wrote:

> Paul,
>
>>> So to keep my application working with clients not sending any
>>> Content-Type,
>>> I have to manually lookup the default JAXB provider and give it a
>>> fake MIME
>>> type, right? So I'll do that...
>>
>> You can write your own JAXB message body readers/writers to accept
>> any
>> media type and override the default behaviour, like i showed in a
>> very
>> simple example leveraging a Jersey helper class.
>
> I know that I can do that by in what way would that be better than
> giving a
> fake MIME to the default body reader?
>

Which is better for the users?

Another solution is to have a container request filter that normalizes
the request into some "standard form". So it could add a content type
header for a particular WebDAV method if the request entity is known
to be of a particular media type. Filters are quite useful in this
respect to normalize requests from particular clients (e.g. looking at
the Agent header)

Paul.