private UriInfo uriInfo;
@GET
@Path("/{type}/{id}")
public Response get(@PathParam("type") String type, @PathParam("id") String id) {
Resource resource = locateResource(type);
if(resource == null) {
return Response.status(404).build();
}
URI uri = uriInfo.getBaseUriBuilder()
.path(resource.getResourceClass())
.path(id)
.build();
return Response.temporaryRedirect(uri).build();
}