title: Simple Spring code to parse JSON
body: <p>I'm a spring newbie. Wrote really simple code to get an array of JSON object from the API call at <a href="http://api.engin.umich.edu/hostinfo/...PONT&amp;room=B505" rel="noreferrer">http://api.engin.umich.edu/hostinfo/...PONT&amp;room=B505</a></p>
  
  <p>Only get "Name: NULL"</p>
  
  <pre><code>import org.springframework.web.client.RestTemplate;
  
  public class Application {
      public static void main(String args[]) {
          RestTemplate restTemplate = new RestTemplate();
          Computer[] computer = restTemplate.getForObject("http://api.engin.umich.edu/hostinfo/v1/computers.json?building=PIERPONT&amp;room=B505", Computer[].class);
          System.out.println("Name:    " + computer[0].getName());
      }
  }
  </code></pre>
  
  <p>Here goes the simple computer class.</p>
  
  <pre><code>package hello;
  import org.codehaus.jackson.annotate.JsonIgnoreProperties;
  
  @JsonIgnoreProperties(ignoreUnknown = true)
  public class Computer {
      private String hostname;
  
      public String getName() {
          return hostname;
      }
  
      public String toString() {
          return "Computer [hostname=" + hostname + "]";
      }
  }
  </code></pre>