Hello all I have a bean that has 3 getters. In the JSP I use JSTL to iterate over the bean to populate a table. I have saome javascript I need to do the same thing to construct an array. Here it is hardcoded, but how can I contruct it by itearing over a bean?
Bean: This is how I do it in the JSP using JSTL
<c:forEach var="bean" items="${beans}">
${bean.month}
</c:forEach>
How Can I do the same thing here:
Javascript:
"categories": [{
"category": [{
"label": "Oct"
}, {
"label": "Nov"
}, {
"label": "Dec"
}, {
"label": "Jan"
}, {
"label": "Feb"
}, {
"label": "Mar"
}, {
"label": "Apr"
}, {
"label": "May"
}, {
"label": "Jun"
}, {
"label": "Jul"
}, {
"label": "Aug"
}, {
"label": "Sep"
}]
}]
Trying to do something like this in javascript
<c:forEach var="bean" items="${beans}">
[{
"label": " ${bean.month}"
},
</c:forEach>