<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="${!empty customerMap}"> <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>
<c:foreach循环一个HashMap,map中的value为一个bean,页面获取key即key对应bean中的属性