I am trying to append a ArrayList to a JavaScript String variable using foreach loop but for some reason it doesn't seem to work. I have been trying to fix this problem for 2 days, but no luck yet. Can anyone help with this? Here's the code.
<div id="graphdiv"></div>
<script type="text/javascript">
var s = "";
<c:forEach items="${dateAndWaitTimes}" var="item">
s.append(${item});
</c:forEach>
g = new Dygraph(document.getElementById("graphdiv"), s);
</script>
Here dateAndWaitTimes contains the ArrayList of String, returned by the controller.
-