jsp遍历List,输出

1.遍历List<Map<String,Object>>html

Java后台返回List<Map<String,Object>>类型的对象jsp遍历的方式java

<table class="t1" style="width:100%;height:20px;">
	<tr class="a1">
		<th>负责人员名称</th><th>已发布的计划数</th><th>未更改的按时完成的计划数</th>
		<th>延期完成数</th><th>更改过的按时完成的计划</th><th>未完成的(延期的和正常的)</th>
	</tr>
	<c:forEach items="${projUserStatistics}" var="projUser">
		<tr class="a1">
			<c:forEach items="${projUser}" var="entry">
				<th>${entry.value}</th>
			</c:forEach>
		</tr>							
	</c:forEach>
</table>

2.输出<Map<String,Objectr>>jsp

后台code

maps.put("taskSchedule", taskScheduleStatistics.get(0));
request.setAttribute("taskScheduleStatistics", maps);

其中,taskScheduleStatistics.get(0)中的数据形如如下:

[{published=1, completeOntimeUnchange=0, completeDelay=1, completeOntimeChanged=0, uncompleted=4}]
htm

jsp取值el表达式便可对象

<th>${taskScheduleStatistics.taskSchedule['published']}</th>