Mark,
I don't understand something. Your thought is that the subresources
should get everything they need from the context. Suppose I have this
path:
/customers/{customerId}/orders/{orderId}/shipping
Let's say shipping is a subresource. For some reason, the shipping
resource needs to know the CustomerID.
How does he get it? He can get the entire URI by injecting it, but he
shouldn't have to know how to parse all these things above him. He
just needs to somehow do something like:
public class ShippingSubResource {
@GET
public Response someShippingMehod (
@PathParam("customerId") String customerId;
) { ... }
}
even though he has no @Path, and the PathParam he's looking from comes
from somewhere several subresources above him (possibly even the root
resource).