jsp中遍歷list中map和遍歷map中list

遍歷map裏的list<br>遍歷mapcode

<c:forEach items="${uMap}" var="map">對象

    獲取map key    ${map.key}it

   遍歷map 下listList

   <c:forEach items="${map.value}" var="list"><br>  若是list是個對象,list.屬性,獲取屬性遍歷

    獲取list內容 ${list.屬性} ${list.屬性} ${list.屬性}map

    </c:forEach>co

</c:forEach>

遍歷list裏的map
先遍歷List,再遍歷Map。相似於
 
  <c:forEach items="${list}" var="temp">
      <c:forEach items="${temp}" var="map">
          ${map.key}---->${map.value}<br>
      </c:forEach>
  </c:forEach>
相關文章
相關標籤/搜索