title: How to make a JSTL foreach loop in javascript code?
body: <p>I am working on a JSP page. I use Spring framework, JSTL and Jquery. I mix some js code and JSTL code. Here is the code :</p>
  
  <p>This is my Spring controller: </p>
  
  <pre><code>Contract contract = services.getContractInfo(contractNumber);
  contract.addCustomer(customer);
  model.addAttribute("contract", contract);
  </code></pre>
  
  <p>This is my Java script:</p>
  
  <pre><code>&lt;script language="javascript"&gt;
      $(document).ready(function(){
          var values = new Array();
          &lt;c:forEach var="customer" items="${contract.customers}" varStatus="status"&gt;
              values.push("${customer.name}");   
          &lt;/c:forEach&gt;
  
          alert(" VALUES =&gt; "+values[0]);
          ....
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Alert shows me <code>"VALUES =&gt; undefined".</code></p>
  
  <p>I don't understand. What's happen ?</p>