users@jersey.java.net

Passing around UriInfo - UriInfo.getAbsolutePathBuilder gets messed up

From: Martin Grotzke <martin.grotzke_at_javakaffee.de>
Date: Sat, 23 Feb 2008 12:32:09 +0100

Hi,

I have some root resource, that creates child resources by itself, not
by using some IoC-features. The parent resource get's the UriInfo
injected, and passes it down to the child resources (e.g. user/widgets
and user/products).

When some resource invokes UriInfo.getAbsolutePathBuilder, the
absoluteUri is set in AbstractContainerRequest and used for all
subsequent calls to UriInfo.getAbsolutePathBuilder - which might be
".../user/widgets/" if it has been called for the widgets resource the
first time, even if the absolutePathBuilder was requested from the
products resource.

What is the intended way of using UriInfo.getAbsolutePathBuilder or more
generally - the usage of UriInfo?

Thanx && cheers,
Martin