①java
entrySet()返回此映射所包含的映射关系的Set视图,即key-value的set集合,类型是Set<Map.Entry<K,V>>
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("001", "xy001");
map.put("002", "xy002");
Set<Map.Entry<String, Object>> entrySet = map.entrySet();
for (Map.Entry<String, Object> entry : entrySet)
{
System.out.println(entry.getKey() + "..." + entry.getValue());
}
②JSTL
<c:forEach items="${map}" var="entry">
${entry.key}:${entry.value}
</c:forEach>
本文转自IT徐胖子的专栏博客51CTO博客,原文链接http://blog.51cto.com/woshixy/1063590如需转载请自行联系原作者
woshixuye111