dev@glassfish.java.net

Re: REST interface on Chrome

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 03 Jun 2010 18:46:20 +0200

On Jun 3, 2010, at 6:00 PM, Alexis Moussine-Pouchkine wrote:
> unfortunately Chrome and Safari (WebKit?) prefer XML over HTML.
> http://www.gethifi.com/blog/webkit-team-admits-accept-header-error


We can modify the admin service in three ways:

1) add a filter to normalize the accept header based on the User-Agent.

2) add a filter to normalize the accept header such that if an HTML-
based media type is explicitly declared the accept header
      is modified such that the HTML-based media type is the most
acceptable.

3) Use the quality of source feature of Jersey and declare HTML as a
higher priority:

        @Produces("text/html;qs=2")

In fact i could fix Jersey such that default quality of source values
can be specified for certain media types which would achieve similar
functionality to that of 2) and one would not require to modify the
@Produces values.

Paul.


> -Alexis
>
> On 3 juin 2010, at 17:56, Tom Mueller wrote:
>
>> The REST management interface (http://server:4848/management/
>> domain) is returning XML when accessed via Google Chrome. IE and
>> Firefox both return HTML.
>> Is this expected?
>>
>> Thanks.
>> Tom
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>