December 2017
Intermediate to advanced
372 pages
8h 46m
English
Sending path parameters to a web service via the JAX-RS client API is easy and straightforward; all we need to do is add a couple of method invocations to specify the path parameter and its value. The following example illustrates how to do this:
package com.ensode.javaee8book..pathparamsclient; import com.ensode.javaee8book.pathparamsclient.entity.Customer; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; public class App { public static void main(String[] args) { App app = new App(); app.getCustomer(); } public void getCustomer() { Client client = ClientBuilder.newClient(); Customer customer = client.target( "http://localhost:8080/pathparams/resources/customer"). ...