Passing a java array and use it in a spring view
<p>I am having some troubles with how to pass variables in spring.</p>

<p>My intention is to pass an double array and to use this to create a google visualization by using the array in javascript.</p>

<p>The problem is that I only get the java object (toString), and I'm not able to loop over the values.</p>

<p>Java file.</p>

<pre><code>double[] array = generateArray();

return new ModelAndView("array", "array", array);
</code></pre>

<p>And in my jsp</p>

<pre><code>dataTable = new google.visualization.DataTable();
var data = '${array}';

dataTable.addColumn('string', 'Task');
dataTable.addColumn('number', 'Hours');
dataTable.addRows(data.length);

for (i=0;i&lt;=data.length;i++)
{
    dataTable.setValue(i, data[i]);
}


var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, {width: 400, height: 240, is3D: true, title: 'My Array'});
</code></pre>

<p>What I want is to be able to loop over the array here. I know I could use Arrays.Tostring(), but this seems unneccesary.</p>
