Java Reference
In-Depth Information
Redirecting based on class
In the preceding example, you want to redirect to a new service that replaces your existing
service. That may not always be the case, however; that method of build URIs allows you to
create some complex values that could redirect to any outside address. But if you simply want
to point to a new service that is a Java class in your application, there's an easy way to do that.
Just use the UriBuilder.fromResource method, and pass it the name of the class that you
want to invoke. Then pass the build method the string that represents your service name:
URI uri = UriBuilder.fromResource(NewService.class).build("newversion");
Search WWH ::




Custom Search