How can I get the full resource URI that is currently sent to JAX-RS? I am trying to return the URI of a newly created object and it needs its prefix part with host, port, etc.:
// @import-s skipped public class Factory { @POST public final Response create() { Integer id; // new object created and id is set return Response.created( URI.create(prefix + "/object/" + id) ).build(); } }
Where can I get this part of prefix ?
source share