users@jersey.java.net

Re: [Jersey] URI based content negotiation

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 10 Oct 2008 09:54:22 +0200

On Oct 10, 2008, at 12:34 AM, Andrew Ochsner wrote:

> Right, I've been searching quite a lot and not found anything
> definitive so I'm asking for some help as a last resort.
>
> I've noticed that URI based content negotiation (/foo.json and /
> foo.xml) has been removed from the JSR. And it looked like it might
> stay in Jersey.
>

Yes, it stayed.


> If that's really the case, are there any examples or snippets
> showing how to configure jersey to do this?
>

It is not as easy as i would like to configure. See this issue [1] for
details and take note of the deployment requirements [2] for Web apps.
It should be able to set this type of thing via the properties. Or
maybe better a filter that is extended with the mapping and added to
the filter chain.

Paul.

[1] https://jersey.dev.java.net/issues/show_bug.cgi?id=108
[2] http://wikis.sun.com/display/Jersey/Overview+of+JAX-RS+1.0+Features#OverviewofJAX-RS1.0Features-DeployingaRESTfulWebservice