IE (all versions from IE6 to IE8 IIRC, not 100% sure about IE6), send
the Accept: */* HTTP header, meaning basically that it will accept any
format for the representation of the resource (even if it's a WEB
browser, supposed to get mostly HTML pages). This sometimes triggers
'funny' or unexpected behaviour with content negotiation techniques
(after all, Accept: */* - Anything - doesn't mean much in the content
negotiation context).

Did you try to put the @Get("html") method before the @Get one? This
sometimes help... otherwise you can try to do this on your application
(your class extending Restlet's Application class):

getTunnelService().setUserAgentTunnel(true);

This will make Restlet 'more intelligent' to handle IE browsers.

Good luck!

On Wed, Oct 13, 2010 at 6:16 PM,  <webp...@tigris.org> wrote:
> Restlet 2.0.1
>
> I have two Get annotations defined:
>
> @Get("htm|html")
> and
> @Get
>
> The get @Get returns a serializable object which jackson serializes to json.
>
> However when I put the url in a browser I would expect the @Get("htm|html") 
> to be called.
>
> I put in some print statement and it seems internet explorer 8 it always 
> requests application/json.
>
> In firefox it does like I expect and requests text/html.
>
> Is there any way to set it up so IE 8 will prefer text/html so the 
> @Get("htm|html") gets called and not my @Get which serves json?
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2671450
>



-- 
Fabián Mandelbaum
IS Engineer

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2671470

Reply via email to