• Post Reply Bookmark Topic Watch Topic
  • New Topic

c:forEach session's map

 
sally bai
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,everyone:
i have a trouble about EL showing the map collection.i put a map(Map<Object1,Object2>) into session.and i want to iterate the map data on my jsp page.the code is like that:
<c:forEach var="entry" items="${pcs}"> //pcs is the Map<Object1,Object2>
<td align="left">${entry.key.name}</td> //i want to show object1's name
</c:forEach>
But it doesn't work,so it's puzzle me a lot?anyone can tell me the problem?
 
sally bai
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,a wonderful thing!i find the problem,because forget to import <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!