Hello Zsolt,

you can specify a default media type on the metadata service of the 
application:
<your app>.getMetadataService().setDefaultMediaType(MediaType.TEXT_HTML);

Best regards,
Thierry Boileau

> Hello
>
> I'm sure I'm missing something trivial, but I can't figure it out.
>
> I have this simple interface:
>
> public interface EntryResource {
>      @Get("html")
>      public Representation asHtml();
>       
>      @Get("json|xml")
>      public Entry retrieve();
>       
>      @Put
>      public void store(Entry entry);
>
>      @Delete
>      public void remove();
> }
>
> I have a server resource class which implements these methods (no @Get
> annotation there). When I don't set the Accept header in request, I
> always get application/json response. How can I set the preferred
> media type to text/html?
>
> When I set Accept: text/html, it returns the html representation.
>
>
>
> Thank you in advance
>
> zsolt
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2449935
>
>

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

Reply via email to