I know that this is a very noob and dumb question, but I need help. Tried several topics and none's working.
So I'm trying to pass a List created in Struts2(java) into javascript to draw a chart using highlight. I've read several articles and come up with this:
$(function drawList() {
var list = [
<c:forEach items="${listFromJava}" var="alistFromJava">
{itemName: "${alistFromJava.attribute}"},
</c:forEach>
];
However it never works, and always ends up with: Static attribute must be a String literal, its illegal to specify an expression.
If I try:
list = '<s:property value="listFromJava"/>
then it returns the reference only.
Any suggestion is appreciated. Thanks in advance.