users@jersey.java.net

Inheriting _at_Path Question

From: Rabick, Mark A (MS) <"Rabick,>
Date: Thu, 5 Mar 2009 16:46:49 -0600

Is there a way to inherit pathing from superclasses of a resource?

Ie.

<Base Class>
@Path("/v1")
public class V1BaseResource {
        @Context
        protected UriInfo uriInfo;
}
</Base Class>

<Sub Class>
@Path("/node")
public class V1NodeResource extends V1BaseResource {

        @GET @Path("/{key}")
        @Produces(MediaType.APPLICATION_XML)
        public Node getNodeByKey( @PathParam("key") String key ) {
                return NodeDB.getNodeByKey(key);
        }
}
</Sub Class>

Where the URI would be like:

http://localhost:7001/rest/root/v1/node/11111

That would allow all methods in the V1NodeResource sub-class to have the shared URI root of "v1".

Is such a thing possible?

-mark
_______________________________________________
Mark A. Rabick
Software Engineer
Northrop Grumman - Integrated Mission Systems (IS/DSD/IMS)
3200 Samson Way
Bellevue, NE 68123
Ph: (402) 293-7091
Em: mark.rabick_at_ngc.com
Remember PFC Ross A. McGinnis...
  http://www.army.mil/medalofhonor/McGinnis/index.html
... MA2 Michael A. Monsoor, Lt. Michael P. Murphy, Cpl. Jason Dunham, SFC Paul Ray Smith and the rest...
  http://www.cmohs.org/recipients/most_recent.htm