Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Jstl foreach iterate over arraylist containing map object using paramvalues

843840Oct 1 2008 — edited Oct 3 2008
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!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 31 2008
Added on Oct 1 2008
4 comments
1,842 views