title: Passing an ArrayList from a Servlet to JSP
body: <p>my model returns an arraylist of strings to servlet in the form</p>
  
  <pre><code>ArrayList&lt;String&gt; currentCustomer = model.getAllCustomers();
  </code></pre>
  
  <p>i want to pass this arraylist from the servlet to the jsp page. how do i do this? below is what i tried</p>
  
  <pre><code>req.setAttribute("currentCustomer", currentCustomer);
  </code></pre>
  
  <p>and in the jsp page, i want to use JSTL to loop over each value and display it. how do i do that? its frustrating me to no end. ive scoured the web but to no avail. any help is greatly appreciated.</p>
  
  <p>here is the jsp code </p>
  
  <pre><code>&lt;%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %&gt;
  
  
  &lt;body&gt;
      &lt;div&gt;
          &lt;c:forEach var="customer" items="currentCustomer"&gt;
              ${customer}
          &lt;/c:forEach&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>