title: How to iterate a list of objects in jstl inside jsp
body: <p>I am trying to iterate a list of objects in my jsp using jstl. I want that for each param name, a dropdown containing the param values appear.</p>
  
  <p>jsp code:</p>
  
  <pre><code>&lt;c:if test="${fn:length(listOfParams) gt 0}"&gt;
      &lt;h2&gt;Yo YO&lt;/h2&gt;
      &lt;c:forEach var="param" items="${listOfParams}"&gt;
          &lt;h3&gt;${param.paramName}&lt;/h3&gt;
          &lt;select name="${param.paramName}" id="${param.paramName}"
              class="target"&gt;
              &lt;c:forEach var="listOfParamValue" items="${param.listOfParamValue}"&gt;
                  &lt;option&gt;&lt;c:out value="${listOfParamValue}" /&gt;&lt;/option&gt;
              &lt;/c:forEach&gt;
          &lt;/select&gt;
      &lt;/c:forEach&gt;
  &lt;/c:if&gt;
  </code></pre>
  
  <p>Controller Code:</p>
  
  <pre><code>    DTEJob dteJob2 = new DTEJob();
      dteJob2.setParamName("ABC");
      dteJob2.addTolistOfParamValue("val1");
      dteJob2.addTolistOfParamValue("val2");
      dteJob2.setDefault(true);
      paramList.add(dteJob2);
      model.addAttribute("listOfParams", paramList);
  </code></pre>
  
  <p>OUTPUT:</p>
  
  <p>Yo YO  and 2 empty drop downs.</p>
  
  <p>Can anyone help why I am unable to retrieve the values in jstl? Any help will be appreciated as I am new to jsp and jstl.</p>
  
  <p>My bean class is:</p>
  
  <pre><code>private String paramName;
  private List&lt;String&gt; listOfParamValue=new ArrayList&lt;String&gt;();
  
  public List&lt;String&gt; getListOfParamValue() {
      return listOfParamValue;
  }
  
  public String getParamName() {
      return paramName;
  } 
  </code></pre>