Hi following is my java code
List<Map> data = new ArrayList<Map>();
Map testData = new HashMap();
testData.put("time","2008-09-27 11:30:00");
testData.put("frequency","143");
data.add(testData);
mav.addObject("list",data);
I want to display this on my view using jstl
To iterate over a plain arraylist containing Integers , the following works
<c:forEach items="${paramValues['list']}" var="int" varStatus = "status">
Value: <c:out value="${int}" />
</c:forEach>
However my arraylist contains hashmaps and I have tried a couple of things including the following
<c:forEach items="${paramValues['list']}" var="record" varStatus = "status">
<c:forEach var="val" items="${record.value}">
<c:out value="${record.key}"/> <c:out value="${val}"/>
</c:forEach>
</c:forEach>
OR
<c:forEach items="${list}" var="record" varStatus = "status">
<c:out value="${record.time}" />
<c:out value="${record.frequency}" />
</c:forEach>
Nothing seems to work!!.. :( Have spent a lot of hours searching for an answer...but the data doesnt show up..
How would I iterate over a hashmap inside a list using paramvalues as for some reason , thats the only method that seems to work??
Thanks for all your help!!