title: how to iterate an ArrayList in JSP
body: <p>I create a JSP which call a java method and get an object ArrayList. I want to display the result in a table but nothing appeared. The jsp is like below:</p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  &lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%&gt;
  &lt;%@ page import="SCOfetch.*" %&gt;
  &lt;%@ page import="java.util.ArrayList" %&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="ISO-8859-1"&gt;
  &lt;title&gt;First Page&lt;/title&gt;
  &lt;% JCOtest connection1 = new JCOtest(); %&gt;
      &lt;%
          ArrayList&lt;CompanyRecord&gt; list = new ArrayList&lt;CompanyRecord&gt;();
          list = connection1.step4QueryTable();
      %&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;c:forEach var="row" items="${list.rows}"&gt;
          &lt;tr&gt;
             &lt;td&gt;&lt;c:out value="${row.getValue(Name)}"/&gt;&lt;/td&gt;
             &lt;td&gt;&lt;c:out value="${row.getValue(Code)}"/&gt;&lt;/td&gt;     
          &lt;/tr&gt;
      &lt;/c:forEach&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The java code of CompanyRecord class is</p>
  
  <pre><code>public class CompanyRecord {
  private String Code;
  private String Name;
  public void setValue(String value,String column)
  {
      if (column.equals("Code"))
      {
          Code=value;
      }
      else 
      {
          Name=value;
      }
  }
  
  public String getValue(String column)
  {
  
      if (column.equals("Code"))
      {
          return Code;
      }
      else 
      {
          return Name;
      }
  }
  }
  </code></pre>
  
  <p>what's the correct way to call an ArrayList lineitem's method? Thanks.</p>