users@jersey.java.net

Nested hierarchies of arbitrary depth

From: Christopher Piggott <cpiggott_at_gmail.com>
Date: Thu, 25 Jun 2009 09:45:42 -0400

What is the best way in jersey to handle hierarchies of arbitrary
depth? For example:

 I have a widget
 a widget can have subwidgets
 subwidgets can also have subwidgets
 subwidgets can have components (but they are the bottom of the tree)

So I might want to find:
    /widget/1212/subwidget/17/component/3414

or

   /widget/12321/subwidget/235235/subwidget/234525/subwidget/234525/component/315

My intuition says that I would do this with a @Path that somehow
delegated to a new instance of the subresource (and so on) as it went
along, recursively. I just can't quite see how to put it together.

--Chris