c:foreach 循环map
(2012-08-30 16:41:28)
标签:
cforeachmapit |
分类: java |
-
<c:forEach
items="${customerMap}" var= "item"> -
${item.code} -
${item.name} -
</c:forEach>
map的结构为: Map customerMap = new HashMap();
写到这里你应该知道以上的内容了,剩下的省略。
另外map对应的value是个对象,如下写法:
-
<table
height= "300"border= "1"cellpadding= "1"> -
<tr> -
<td width="396"> -
<select id="selectAllList" name= "selectAllList"style= "width:300px"size= "<%=Constants.choicePageCount%>"multiple= "true"> -
<c:if test= "${!emptycustomerMap}" > -
<c:forEach items="${customerMap}" var= "item"> -
<option value="${item.key }" -
title=" 编码:${item.value.customer_num },许可证号:${item.value.license_key >},简 称:${item.value.short_name },联系地址:${item.value.contact_address },联系电 话:${item.value.contact_phone }" -
${item.value.corporate_name }</option> -
</c:forEach> -
</c:if> -
</select> -
</td> -
</tr> -
</table>