<c:forEach var="plate" items="${plate}"> // 获取request.getAttribute("plate") list对象
<div class="Plate_1">
<div class="Plate_title">
<div class="Plate_Name">
<img src="bbs/images/45.png" width='40px';>
<b>${plate.plateName }</b> //读取第一个对象plate的plateName数据
</div>
</div>
<ul>
<li>
<img src="bbs/images/15.png" width="40px">
<a href="bbs/list.htm?id=${plate.subPlate[0].id }">${plate.subPlate[0].subPlateName }</a> //读取第二个联级对象subPlate中的.subPlateName数据.
</li> //通过数组循环
</ul>
</div>
</c:forEach>
<div class="Plate_1">
<div class="Plate_title">
<div class="Plate_Name">
<img src="bbs/images/45.png" width='40px';>
<b>${plate.plateName }</b> //读取第一个对象plate的plateName数据
</div>
</div>
<ul>
<li>
<img src="bbs/images/15.png" width="40px">
<a href="bbs/list.htm?id=${plate.subPlate[0].id }">${plate.subPlate[0].subPlateName }</a> //读取第二个联级对象subPlate中的.subPlateName数据.
</li> //通过数组循环
</ul>
</div>
</c:forEach>
本文介绍了一种使用JSP和EL表达式遍历后台传来的板块数据的方法,并展示了如何在前端页面上显示这些数据。具体包括使用<c:forEach>标签进行循环、获取板块名称及子板块详情。
443

被折叠的 条评论
为什么被折叠?



