Paths are always relative, if that helps. I believe a @GET method without a
@Path means the root of that context. If you return a resource from a
resource, that resource's URLs will be relative. I think that's a good thing
from an abstraction perspective, the Incidents defines a URL structure
"/incident/{iid}", but doesn't say how it is rooted. So when it's returned
from a Customer, then it is /customer/{cid}/incident/{iid}, but Incidents
doesn't care about that. So if you want to return incidents from a company
(/company/{cName}/incident/{iid}), you can do that without changing the
Incidents resource class -- you just are returning it from two different
places now.
I'm still playing around with Jersey "academically" and haven't done a
real-world project with it yet, but what I said is based on what I've figured
out so far, and it seems practical to apply in a real application.
Jason
On 7/9/2010 12:36 PM, Basmajian, Raffi wrote:
>
> Ok, thanks for the tip.
>
> One other question, if I decide to annotate at the POJO level, is it
> required to set the @Path("") configuration in each resource to reflect
> the object hierarchy, or is that handled automatically by Jersey?