0
私はオブジェクトのarraylistを返す、私はこのarraylistを返す安らかなクライアントを作成したが、次のコードのような文字列を返す、今私はオブジェクトのarraylistとしてそれを取得したい。安らかなjersyクライアントでarraylistを取得する
オブジェクト
@RequestMapping(value = "/getQuery",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
@Timed
public List<User> get() throws JSONException {
return userRepository.findAll();
}
jersyクライアント一般
Client client = Client.create();
WebResource webResource = client
.resource("http://localhost:8080/myproject/api/getQuery");
ClientResponse response = webResource.accept("application/json")
.get(ClientResponse.class);
String output = response.getEntity(String.class);
//how to get arraylist from responce