title: Java ArrayList using in JSTL(<c:foreach>)
body: <p>i want foreach items add arrays list</p>
  
  <pre><code>&lt;sql:query var="query"  dataSource="${db}"&gt;
  
     select fname, lname from users where fname='ali'
  
  &lt;/sql:query&gt;
  
  &lt;c:forEach items="${query.rows}" var="result"&gt; 
  
   &lt;% 
  
    ArrayList l= new ArrayList();
    l.add("${result.fname}");
    l.add("${result.lname}");
  
  
   for(int i=0; i&lt;l.size(); i++)
     {
     out.println(l.get(i));
     }
   %&gt;
  
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>output result: </p>
  
  <pre><code>${result.fname} ${result.lname}  ${result.fname} ${result.lname}  ${result.fname} ${result.lname} 
  </code></pre>
  
  <p>what is wrong ?</p>