今天在项目中遇到需要将后台传入的Map<String, List<Meeting>> dateGroup类型的集合在jsp中显示,刚开始还以为很麻烦,结果在网上查了一下原来如此简单,呵呵:
[b]<c:forEach items="${dateGroupMap}" var="dateGroup" >[/b]
<tr>
[b]<td width="20%" valign="bottom">${dateGroup.key[/b]}</td>
</tr>
[b]<c:forEach items="${dateGroup.value}" var="meeting">[/b]
<tr>
<td colspan="4"><hr></td>
</tr>
<tr height="20">
<td height="20">${meeting.startDate}
<c:if test="${not empty meeting.endDate}">
--${meeting.endDate}
</c:if>
</td>
<td height="20">${meeting.title}</td>
<td height="20">${meeting.location}</td>
<td height="20">${meeting.content}</td>
</tr>
</c:forEach>
</c:forEach>