Hi,
assuming that I am somewhere deep in a web request defined by sub
locators, and I want to construct a URI to some resource.
What is the recommended way to do so?
I'm currently using UriInfo.getAbsolutePathBuilder(), but the problem
is I can't see a way to construct my path to a specific object if that
is only reachable through sub locators, in particular if I need to
construct a "parent" link - i.e. if I'm not descending further in the
path hierarchy, but trying to go upwards. My current solution is to
use the raw URI and resolve(...), but that seems like a hack.
The general problem is of course hard because it's not possible to
know the absolute, canonical path to some sub resource. But if we
already have the list of steps how we got "here", there should be a
way to move upwards again, right?
I see there is UriInfo.getMatchedResources() and
UriInfo.getMatchedURIs(), but how do I use those?
Martin