Hello Chuck,

there is a start for a solution for included in Restlet: the Metadata Service. It is for now only used by the com.noelios.restlet.application.TunnelFilter. But you can create a filter that does this, and use the MetadataService. It includes a lot of file extensions.

I think, other people are happy, if they can use this filter also. I think it is good if you open an enhancement issue for this and add your Filter class file as attachment, so that Jerome or Thierry could include this in the official version. (Jerome, I hope it's ok that I wrote this :-) )

BTW: ".js" is the typical file extension for javascript. Use ".json"

best regards
  Stephan

Chuck Mortimore schrieb:
I'm trying to serve different representations based upon the file extension
provided in the URI.
For instance, if I get

http://server/user/cmort.js

I want to return this variant: MediaType.APPLICATION_JSON

but if I get http://server/user/cmort.rss

I want to return this variant: MediaType.APPLICATION_ATOM_XML

Anyone have advise on how I effect the variant passed into my resource to meet
this use case?

thanks!

Reply via email to