For future reference, I solved this by adding the following line to my
Restlet Application's constructor.

getMetadataService().setDefaultMediaType(MediaType.TEXT_HTML);


On Wed, Feb 2, 2011 at 7:06 PM, Danny Leshem <[email protected]> wrote:

> I have a resource that returns representations in either “text/html” or
> “application/json”.
>
>
>
> Everything works as expected when clients specify the “Accept” HTTP header.
> Otherwise, the server returns JSON by default, whereas I want it to return
> HTML. The question is how to do that.
>
>
>
> A previous thread by Kevin Daly (
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2646542)
> says that the default representation is determined according to the order of
> plugins in the classpath. Is there a programmatic way to specify the default
> representation, e.g. using Restlet annotations?
>
>
>

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

Reply via email to