In short:In my JSP, I need to iterate over a list of custom defined bean class, like List,MyClass has key and value variables, and also getters and setters for the same, using the c:foreach jstl
Details: something like this:
<c:forEach var="myObject" items="${model.pair_list}">
<li data-value="${myObject.key}">${myObject.value}</li>
</c:forEach>
In the Java code, I have :
List pairlist = new ArrayList(); //MyClass is a simple bean class with variables "key", and "value", and getters and setters for the same //put a few values in this list model.put("pair_list", pairlist);
Any hints how to get this working?