users@jersey.java.net

Re: [Jersey] prioritising HTML representations in web applications when using implicit or explicit views

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 28 Jan 2009 09:50:58 +0100

On Jan 28, 2009, at 12:47 AM, James Strachan wrote:

> 2009/1/27 James Strachan <james.strachan_at_gmail.com>:
>> Awesome stuff Paul, many thanks! Taking it for a spin now...
>
> It works like a charm! Great stuff Paul!
>

Great. I am still not sure about the prioritization aspect of media
types declared with @ImplicitProduces, it seems a hack that might be
hard to remove when priorities are supported, or not be of the
desirable behavior for some. It would be more consistent if
@ImplicitProduces has the same order semantics as @Produces.

Thus I think instead we should support a application request filter
that looks at the user-agent header and accept header and then
modifies the latter. Then that filter can be included as part of the
application. IMHO that would be a better way to work around the odd
Safari accept header. What do you think?


> I've attached a patch to issue 190
> https://jersey.dev.java.net/issues/show_bug.cgi?id=190
>
> which has refactored the testing code to use Jetty rather than
> GlassFish (until someone works out how to get GlassFish embedded and
> JSTL to work nicely with Maven/SureFire). I've left the GlassFish code
> intact in a WebContainerFacade implementation so we should hopefully
> be able to test in both one day quite easily. (See the
> createWebContainerFacade() in TestSupport for details).
>
> The tests now check Bookstore and Item resources as HTML and XML and
> things all appear to work perfectly now the @ImplicitProduces is being
> used! Thanks again Paul!
>

Thanks, i will apply the patch today.

Paul.