ResourceContext.matchResource(URI) allows me to convert a URI to a Resource, but how do I go from a Resource to its URI?
Answering my own question:
@Context UriInfo uriInfo;
public URI getUri()
{
return uriInfo.getBaseUriBuilder().path(MyResource.class).build();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With