How to create an array in javascript using attributes set in the request object?
<p>I need to creata an array in javascript, elements for the array should come from server side.</p>

<p>For this what i did was,
In servlet,</p>

<pre><code>String[] valuesArray = {"val1","val2","val3"};
request.setAttribute("valuesArray",valuesArray);
</code></pre>

<p>In Jsp/javaScript: 
<code>var arrayObj = new Array(${'valuesArray'});</code></p>

<p>but,this is not working.. 
Ultimately, arrayObj should contain {"val1","val2","val3"} as elements.
Can someone please suggest where i have gone wrong or let me know how to handle this requirement? </p>

<p>Thanks in advance.</p>
