title: How to transfer java array to javaScript array using jsp?
body: <p>I have a list of strings on my server which I am trying to get to the client in the form of an array. The code I am attempting to use is the following:</p>
  
  <p>Within the jsp I have a <code>List&lt;String&gt;</code> column</p>
  
  <p>I am attempting the following code:</p>
  
  <pre><code>&lt;%int j = 0; %&gt;
  for(var i = 0; i &lt; &lt;%=columns.size()%&gt;; i++)
  {
    colArray[i] = "&lt;%=columns.get(j++)%&gt;";
  }
  </code></pre>
  
  <p>This code simply returns the first element in the columns list for every element in the colArray.</p>
  
  <p>I have also tried:</p>
  
  <pre><code>colArray = &lt;%=columns.toArray()%&gt;;
  </code></pre>
  
  <p>which does not work either. 
  I feel like I am making a little mistake somewhere and am just not seeing it. Is what I am trying to do possible in the way that I am attempting? </p>
  
  <p>Thanks.</p>