How can I get a full URI of the resource currently dispatched in JAX-RS? I'm trying to return a URI of newly created object, and need a prefix part of it, 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 prefix
part?