title: Iterate ArrayList in JSP
body: <p>I have two arraylists in my class and I want to send it to my JSP and then iterate the elements in arraylist in a select tag.</p>
  
  <p>Here is my class:</p>
  
  <pre><code>package accessData;
  
  import java.util.ArrayList;
  
  public class ConnectingDatabase 
  {
     ArrayList&lt;String&gt; food=new ArrayList&lt;String&gt;();
     food.add("mango");
     food.add("apple");
     food.add("grapes");
  
     ArrayList&lt;String&gt; food_Code=new ArrayList&lt;String&gt;();
     food.add("man");
     food.add("app");
     food.add("gra");
  }
  </code></pre>
  
  <p>I want to iterate food_Code as options in select tag and food as values in Select tag in JSP; my JSP is:</p>
  
  <pre><code>&lt;select id="food" name="fooditems"&gt;
  
  // Don't know how to iterate
  
  &lt;/select&gt;
  </code></pre>
  
  <p>Any piece of code is highly appreciated. Thanks in Advance :)</p>