Re: Java library for content negotiation

Thanks,

I could do a similar thing but I didn't want to make up a parser for
the Accept request header if someone had already made one up and
distributed it in a library. If the user only puts one content type in
the Accept header it is simple but if they put multiple types in, like
Browsers generally do, then it gets more complicated and I wanted to
avoid reimplementing the logic for that bit.

Cheers,

Peter

2009/4/28 Carlos Rueda <carueda@mbari.org>:
> Hi Peter,
>
> On Sun, Apr 26, 2009 at 9:12 PM, Peter Ansell <ansell.peter@gmail.com>
> wrote:
>>
>> How do other projects do content negotiation in Java?
>
> I don't have a generic library for content negotiation to offer but wanted
> to briefly mention our current approach in the Marine Metadata
> Interoperability project [1].  Hope this is useful information.
>
> As a standard servlet, the URI resolver component of our MMI Ontology
> Registry and Repository [2] uses the getHeaders method in HttpServelRequest,
> and then a helper class [3], as a basis to resolve an ontology or term URI
> in the appropriate format depending on the "accept" header sent by the
> client, and according to [4], which pretty much is in compliance with [5].
>
> Good luck,
> Carlos
>
> [1] http://marinemetadata.org
> [2] http://mmisw.org/or
> [3]
> http://code.google.com/p/mmisw/source/browse/trunk/org.mmisw.ont/src/org/mmisw/ont/util/Accept.java
> [4] http://marinemetadata.org/apguides/ontprovidersguide/urlresolution
> [5] http://www.w3.org/TR/swbp-vocab-pub/
>
>
>
> --
> Carlos Rueda, PhD
> MMI Technical Lead - marinemetadata.org
> carueda@mbari.org - 831-775-1929
> Monterey Bay Aquarium Research Institute - mbari.org
>

Received on Monday, 27 April 2009 23:02:08 UTC