title: Java Rest - send parametrized List using GET method
body: <p>I am trying to send a List by GET method.</p>
  
  <p>Here is my Server side: </p>
  
  <pre><code>@GET
  @Produces(MediaType.APPLICATION_JSON)
  public List&lt;User&gt; getUsers(){
      return managment.getUsers();
  }
  </code></pre>
  
  <p>And my client side: </p>
  
  <pre><code>public static void getUsers(){
      try {
          ClientConfig clientConfig = new DefaultClientConfig();
          clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
          Client client = Client.create(clientConfig);
  
  
  
  
          WebResource webResource = client
                  .resource("http://localhost:8080/Serwer07/user");
  
          ClientResponse response = webResource.accept("application/json")
                  .get(ClientResponse.class);
  
          if (response.getStatus() != 200) {
              throw new RuntimeException("Failed : HTTP error code : "
                      + response.getStatus());
          }
  
         List users = response.getEntity(List.class);          
         User user = (User) users.get(0);  //cannot cast
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>I have problem with cast from Java Object to User. How can I send this List ? </p>
  
  <p>Thanks in advance.</p>