document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. //...
  2.     @Override
  3.     protected void doGet(HttpServletRequest request, HttpServletResponse response)
  4.             throws ServletException, IOException {
  5.         Client client = ClientBuilder.newClient(); //creamos un nuevo cliente...
  6.         client.register(PersonsReader.class); //... registramos nuestro interprete JSON -> Bean
  7.         WebTarget target = client.target(URL);
  8.         LOGGER.info("Solicitamos al Servicio REST el listado");
  9.         List<Person> lista = target.request().get(List.class);
  10.         LOGGER.log(Level.INFO, "Persona:{0}", lista);
  11.         request.setAttribute("personas", lista);
  12.     }
  13. //...
');