Hi, all-

(Using Restlet JEE 2.1 RC, Java 7, Tomcat7.)

I am writing a new service, and want to serve both a JSON and an XML version of 
my representations. I therefore have a @Get("json") handler and a @Get("xml") 
handler for each Resource.  I have also enabled the extensions tunnel in my 
TunnelService, and this seems to be working without any difficulty. URLs that 
end with .json are retrieving the JSON representation, and URLs that end with 
.xml are retrieving the XML representation.

Here's the problem I'm having:  If a URL is specified without a file extension, 
I want the service to default to sending the JSON representation. When the 
service is starting up, I used the MetadataService and specified that the 
default Media Type should be MediaType.APPLICATION_JSON. Despite this, the XML 
representation is being returned, and I can't figure out why.

I used the MetadataService in a prior project to do exactly the same thing, and 
it worked without a problem. (That older project used Restlet JEE 2.0, Java6 
and Tomcat 6, if that's relevant.)

What could I be overlooking?

Thanks for your help!

--------------------------
John Wismar
Alldata Technology
916-478-3296

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

Reply via email to