users@jersey.java.net

[Jersey] Specifying different sub-resources depending on the Content-Type?

From: Gili <cowwoc_at_bbs.darktech.org>
Date: Fri, 17 Jun 2011 07:23:31 -0700 (PDT)

Hi,

Currently when I want to specify sub-resource I do:

@Path("devices")
class Devices
{
  [...]
  @Path("{id}")
  public getDevice(@PathParam("id") long id)
  {
    return new Device(id);
  }
}

Now I have two different kind of devices, both mapped under /devices/{id}
except that some IDs are mapped to one device type and some to another. Is
it possible to specify two sub-resource methods and have Jersey instantiate
a different sub-resource Class depending on the content-type being
requested?

Thanks,
Gili

--
View this message in context: http://jersey.576304.n2.nabble.com/Specifying-different-sub-resources-depending-on-the-Content-Type-tp6487299p6487299.html
Sent from the Jersey mailing list archive at Nabble.com.