title: JAXB - unmarshalling from url
body: <p>I'm tryting to display title and id of game from this site:
  <a href="http://thegamesdb.net/api/GetGame.php?id=2" rel="noreferrer">http://thegamesdb.net/api/GetGame.php?id=2</a></p>
  
  <p>When I was unmarshalling from this url: <a href="http://www.w3schools.com/xml/note.xml" rel="noreferrer">http://www.w3schools.com/xml/note.xml</a> it was all ok, but here was just one object, not a list. So I'm having problem now. I was reading some tutorials and examples from Google and I made this code:</p>
  
  <p>Data.java:</p>
  
  <pre><code>@XmlRootElement( name = "Data" )
  @XmlAccessorType (XmlAccessType.FIELD)
  public class Data {
      @XmlElement(name = "Game")
      List&lt;Game&gt; games;
  
      public List&lt;Game&gt; getGames() {
          return games;
      }
  
      public void setGames(List&lt;Game&gt; games) {
          this.games = games;
      }
  }
  </code></pre>
  
  <p>Game.java file:</p>
  
  <pre><code>@XmlRootElement(name = "Game")
  @XmlAccessorType (XmlAccessType.FIELD)
  public class Game {
      private int id;
      private String gameTitle;
  
      public int getId(){
          return id;
      }
  
      public void setId(int id){
          this.id = id;
      }
  
      public String getGameTitle(){
          return gameTitle;
      }
  
      public void setGameTitle(String gameTitle){
          this.gameTitle = gameTitle;
      }
  }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>@RequestMapping(value = "/", method = RequestMethod.GET)
  public ModelAndView home(Locale locale) throws MalformedURLException {
      ModelAndView model = new ModelAndView("index");
      JAXBExample test = new JAXBExample();
      Game customer = test.readXML();
      model.addObject("customer", customer);
      return model;
  }
  </code></pre>
  
  <p>JAXBExample.java:</p>
  
  <pre><code>public class JAXBExample {
      public Game readXML() throws MalformedURLException {
          Data customer = null;
          Game game = null;
          try {
              JAXBContext jaxbContext  = JAXBContext.newInstance(Data.class);
              URL url = new URL("http://thegamesdb.net/api/GetGame.php?id=2");
              Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
              customer = (Data) jaxbUnmarshaller.unmarshal(url);
              List&lt;Game&gt; games = customer.getGames();
              game = games.get(0);
          } catch (JAXBException e) {
              e.printStackTrace();
          }
          return game;
      }
  }
  </code></pre>
  
  <p>And index.jsp:</p>
  
  <pre><code>&lt;%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%&gt;
  
  &lt;tiles:insertDefinition name="defaultTemplate"&gt;
      &lt;tiles:putAttribute name="body"&gt;
          Name: ${customer.gameTitle}&lt;br /&gt;
          Id: ${customer.id}&lt;br /&gt;
      &lt;/tiles:putAttribute&gt;
  &lt;/tiles:insertDefinition&gt;
  </code></pre>
  
  <p>But my code isn't working. Somebody have maybe idea what I'm doing wrong? Because as result I just get:</p>
  
  <pre><code>Name:
  Id: 
  </code></pre>
  
  <p>And nothing more.</p>