title: JSP foreach doesnt print the content of list
body: <p>I have a small problem with foreach in jsp</p>
  
  <p>I tried to do everything like in <a href="https://stackoverflow.com/questions/818072/jstl-jsp-iterating-over-a-vector-of-beans">jstl/jsp - iterating over a vector of beans</a> but I cant get anything printed on my screen</p>
  
  <p>here is some code:</p>
  
  <pre><code>&lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;title&gt;JSP Page&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;h1&gt;Shop products&lt;/h1&gt;
          &lt;table&gt;
              &lt;c:forEach var="item" items="${products}"&gt;
                  &lt;tr&gt;
                      &lt;td&gt;
                          &lt;c:out value="${item.name}"/&gt;
                      &lt;/td&gt;
                  &lt;td&gt;
                      &lt;c:out value="${item.amount}"/&gt;
                  &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/c:forEach&gt;
          &lt;/table&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My servlet processRequest():</p>
  
  <pre><code>protected void processRequest(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
      products = new LinkedList&lt;ProductHandler&gt;();
      products.add(new ProductHandler("A", 5));
      products.add(new ProductHandler("B", 10));
      products.add(new ProductHandler("C", 7));
      request.setAttribute("products", products);
      getServletContext().getRequestDispatcher("/JSP/shop.jsp").forward(request, response);
  }
  </code></pre>
  
  <p>And ProductHandler:</p>
  
  <pre><code>public class ProductHandler {
      private String name;
      private int amount;
  
      public ProductHandler() { 
          name = null;
          amount = 0;
      }
  
      public ProductHandler(String name, int amount) {
          this.name = name;
          this.amount = amount;
      }
  
      /**
       * @return the name
       */
      public String getName() {
          return name;
      }
  
      /**
       * @param name the name to set
       */
      public void setName(String name) {
          this.name = name;
      }
  
      /**
       * @return the amount
       */
      public int getAmount() {
          return amount;
      }
  
      /**
       * @param amount the amount to set
       */
      public void setAmount(int amount) {
          this.amount = amount;
      }
  
  }
  </code></pre>
  
  <p>Id be very grateful for pointing out any mistake I made</p>