jsp中用jstl 遍历map

本文介绍了如何在JSP页面中利用JSTL标签库遍历Map对象,重点在于理解和使用key与value。其他细节相对次要。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 <c:forEach items="${listLinkedHashMap}"  var="map">
            <div class="subtitle">${list.key}</div>
            <div class="tbWrap">
                <table>
                    <th>姓名</th><th>手机号</th><th>操作</th></tr>
                    <c:forEach var="item"  items="${list.value}" >
                        <tr>
                            <td>${item.name}</td>
                            <td>${item.mobile}</td>
                            <c:if test="${item.exchangeStatus eq 0}">
                                <td class="auction"><span>兑奖</span><span class="del">作废</span></td>
                            </c:if>
                            <c:if test="${item.exchangeStatus eq 2}">
                                <td class="auctioned">已兑奖</td>
                            </c:if>
                            <c:if test="${item.exchangeStatus eq 1}">
                                <td class="auctioned">已作废</td>
                            </c:if>
                      </tr>
                    </c:forEach>
                </table>
            </div>
            </c:forEach>


在jsp中用jstl 遍历map 的写法,注意其中的key value ,其他的也没什么好关注的了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值