title: Unable to print out list object contents using JSTL
body: <p>I am retrieving rows from a Mysql database and storing each row as an object in a list.
  I pass the list to the request scope where I am attempting to use JSTL to loop over the list and access the object variables.</p>
  
  <p>Here is how I retrieve the rows as objects:</p>
  
  <pre><code>    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
  
          // get list of objects
          List&lt;Game&gt; gameRatingsThisWeek = getHighestRatedGameThisWeek();
          request.setAttribute("gameRatingsThisWeek", gameRatingsThisWeek);
  
          RequestDispatcher rd = getServletContext().getRequestDispatcher("/dashboard.jsp");
          rd.forward(request, response);
  
      private List&lt;Game&gt; getHighestRatedGameThisWeek() {
          List&lt;Game&gt; list = new ArrayList&lt;Game&gt;();
          try(Connection con = ds.getConnection()){
              String query =   "SELECT overallRating, count(*) as Total, g.name"
                              +"FROM gameSurvey gs, game g"
                              +"WHERE g.id = gs.gameID AND"
                              +"date BETWEEN (NOW() - INTERVAL 7 DAY) AND NOW()"
                              +"GROUP by overallRating"
                              +"ORDER by Total desc";
              PreparedStatement ps = con.prepareStatement(query);
              ResultSet rs = ps.executeQuery();
              while(rs.next()){
                  Game game = new Game();
                  game.setName(rs.getString("name"));
                  game.setRating(rs.getInt("overallRating"));
                  game.setTotal(rs.getInt("Total"));
                  list.add(game);
              }
              ps.close();
  
          }catch(SQLException e){}
          return list;
  
      }
  
  }
  </code></pre>
  
  <p>I know the SQL query is fine, because I tested it previously.</p>
  
  <p>Here is the Game class:</p>
  
  <pre><code>public class Game {
      private int rating, total;
      private String name;
  
      // get
      public int getRating(){
          return rating;
      }
      public int getTotal(){
          return total;
      }
      public String getName(){
          return name;
      }
  
      // set
      public void setRating(int rating){
          this.rating = rating;
      }
      public void setTotal(int total){
          this.total = total;
      }
      public void setName(String name){
          this.name = name;
      }
  }
  </code></pre>
  
  <p>In the dashboard.jsp file I attempt to loop through the list:</p>
  
  <pre><code>&lt;c:forEach items="${gameRatingsThisWeek}" var="game"&gt;
      &lt;c:out value="${game.name}"&gt;&lt;/c:out&gt;
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>I navigating to the servlet that retrieves and forwards to the .jsp page. But nothing is output to the webpage. </p>