title: Iterating over ArrayList items with JSTL forEach
body: <p>I'm having problem running over ArrayList items and displaying them in JSP file.</p>
  
  <p>Here is my bean:</p>
  
  <pre><code>public class UsersList {
      private ArrayList&lt;UserDetails&gt; users = new ArrayList&lt;UserDetails&gt;();
  
      public ArrayList getUsers(  ){
          return users;
      }
  
      public void setUsers(ArrayList&lt;UserDetails&gt; users){
          this.users = users;
      }
  }
  </code></pre>
  
  <p>users contains UserDetails which is simply class with 3 String properties: email, username, password</p>
  
  <p>Now I am trying to display the details in a table.. first in index.jsp I have those commands:</p>
  
  <pre><code>            UsersList bean = new UsersList();
              bean.setUsers(db.getUsersList()); // getting all user deatils from database into the list
              session.setAttribute("bean", bean);
  
              RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/adminPage.jsp");
              dispatcher.forward(request, response);
  </code></pre>
  
  <p>And now on adminPage.jsp when I should display the table containing the users details, its displays nothing. Here is the code:</p>
  
  <pre><code>&lt;c:forEach var="current" items="${bean.users}" &gt;
  &lt;tr&gt;
      &lt;td&gt;${current.email}&lt;/td&gt;
      &lt;td&gt;${current.username}&lt;/td&gt;
      &lt;td&gt;&lt;input type="checkbox" name="delete" value="${current.email}"&lt;/td&gt;
  &lt;/tr&gt;
   &lt;/c:forEach&gt;
  </code></pre>
  
  <p>Any idea what's the problem here?? Thanks.</p>