- Create an initialization method in javascript file
- display properties on the page containing js. so that they form a valid javascript structure (array, object, whatever)
- pass the structure to the initializer.
The first step may look (in the .js file):
var options; function init(initOptions) { options = initOptions; }
The second step may look like this: (on the jsp page):
var a = new Array(); <c:forEach items="${properties}" var="entry"> a.push({key: '${entry.key}', value: '${entry.value}'}); </c:forEach>
And finally, init(a);
Bozho source share