@Path(value="client") public class ClientResource extends Object
@Uri annotation to query
external resources and resource from StandardResource.| Constructor and Description |
|---|
ClientResource() |
| Modifier and Type | Method and Description |
|---|---|
String |
animals(javax.ws.rs.client.WebTarget dogWebTarget,
javax.ws.rs.client.WebTarget catWebTarget,
javax.ws.rs.client.WebTarget elefantWebTarget)
Query
StandardResource and return result based on the results from methods of the StandardResource. |
String |
car(javax.ws.rs.client.WebTarget webTarget,
String id)
Query
StandardResource using a injected client. |
javax.ws.rs.core.Response |
glassfish(javax.ws.rs.client.WebTarget webTarget)
Make request to external web site using injected client.
|
@GET
@Produces(value="text/html")
@Path(value="glassfish")
public javax.ws.rs.core.Response glassfish(@Uri(value="http://glassfish.java.net/")
javax.ws.rs.client.WebTarget webTarget)
webTarget - Injected web target.@GET @Produces(value="text/plain") @Path(value="animals") public String animals(@Uri(value="resource/dog") javax.ws.rs.client.WebTarget dogWebTarget, @Uri(value="resource/cat") javax.ws.rs.client.WebTarget catWebTarget, @Uri(value="resource/elefant") javax.ws.rs.client.WebTarget elefantWebTarget)
StandardResource and return result based on the results from methods of the StandardResource.dogWebTarget - Injected client.catWebTarget - Injected client.elefantWebTarget - Injected client.@GET
@Produces(value="text/plain")
@Path(value="car/{id}")
public String car(@Uri(value="resource/car/{id}")
javax.ws.rs.client.WebTarget webTarget,
@PathParam(value="id")
String id)
StandardResource using a injected client. The client injection is using a template parameter id
which is filled by JAX-RS implementation using a path parameter of this resource method.webTarget - Injected client.id - Path parameter.Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.