[jax-rs-spec users] UriInfo CDI enabled

From: Sebastian Daschner <>
Date: Mon, 1 Feb 2016 21:56:38 +0100

Hi experts,

Thanks for the work done so far.

We had the case in projects that we wanted to construct URIs based on
UriInfo without wanting to pass the current UriInfo into other
(dedicated helper) classes.

Do you think it's feasible to enable the request scoped UriInfo (plus
maybe others) for CDI injection, in order to decouple potential URI
construction classes from the JAX-RS resources?

So something like follows would be possible (to call the method from any

public class BookstoreUriBuilder {

    UriInfo uriInfo;

    public URI forBook(Book book) {
        return uriInfo.getBaseUriBuilder()
            .path(BooksResource.class, "getBook")