title: How to consume JSON response with spring restemplate properly?
body: <p>I have a Spring MVC Rest service that return JSON value, i have 8 row, here is my JSON</p>
  
  <pre><code>[
  {"no":"1","date":"2015-03-30","grandtotal":699618,"diskon":699618},
  {"no":"2","date":"2015-03-30","grandtotal":1867949,"diskon":1867949},
  {"no":"3","date":"2015-03-27","grandtotal":2190909,"diskon":2190909},
  {"no":"4","date":"2015-03-26","grandtotal":8616120,"diskon":8616120},
  {"no":"5","date":"2015-03-26","grandtotal":1095455,"diskon":1095455},
  {"no":"6","date":"2015-03-24","grandtotal":938961,"diskon":938961},
  {"no":"7","date":"2015-03-24","grandtotal":5603848,"diskon":5603848},
  {"no":"8","date":"2015-03-20","grandtotal":3735899,"diskon":3735899}
  ]
  </code></pre>
  
  <p>What i trying.. Here is my controller. SpringRestController.java
  Jackson Way :</p>
  
  <pre><code>@RequestMapping(value = "/view", method = RequestMethod.GET)
  public String initCreationForm(Map&lt;String, Object&gt; model) {
  
      String url = "http://localhost:8080/SpringServiceJson/view/";
  
      RestTemplate restTemplate = new RestTemplate();
      TotalDiscList totaldisc = restTemplate.getForObject(url, TotalDisc.class);
  
  
      model.put("DiscValue",totaldisc);
      return "salesorders/totalDisc";
  }
  </code></pre>
  
  <p>Gson way :</p>
  
  <pre><code>public String initCreationForm(Map&lt;String, Object&gt; model) {
  
  String url = "http://localhost:8080/SpringServiceJson/view/";
  
  Gson gson = new Gson();
  
  Collection&lt;TotalDisc&gt; totaldisc = gson.fromJson(url, PiutangListJson.class);
  
  
  
      model.put("DiscValue",totaldisc);
      return "salesorders/totalDisc";
  }
  </code></pre>
  
  <p>what i missed here? it always give me this error 
  <strong>"Could not extract response: no suitable HttpMessageConverter found for response type [class [Lorg.springframework.samples.my.model.TotalDiscList;] and content type [application/json]"</strong></p>
  
  <p>Here is my object TotalDiscList.java</p>
  
  <pre><code>public class TotalDiscList {
  
      private String no;
      @DateTimeFormat(pattern="dd-MM-yyyy")
      private Date date;
      private long grandtotal;
      private long diskon;
  
  //getter setter skipped
  }
  </code></pre>
  
  <p>i should return <code>List&lt;TotalDiscList&gt; totaldisc = restTemplate.getForObject(url, List&lt;TotalDisc&gt;.class);</code> right?
  how i do that properly?</p>