當前位置:
首頁 >
c:forEach循环的List为String时的写法
發布時間:2025/3/19
41
豆豆
生活随笔
收集整理的這篇文章主要介紹了
c:forEach循环的List为String时的写法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
場景
使用<c:forEach標簽時通常是遍歷對象List,比如下面這種:
<c:forEach items="${flights}" var="flight">?<tr><td class="pass_width_ave_6_column">${flight.chineseName}</td><td class="pass_width_ave_6_column">${flight.chineseLastName}</td><td class="pass_width_ave_6_column">${flight.chineseFirstName}</td><td class="pass_width_ave_6_column">${flight.idType}</td><td class="pass_width_ave_6_column">${flight.idCode}</td><td class="pass_width_ave_6_column">${flight.bookStatusName}</td></tr>?</c:forEach>當遍歷的List不是對象,而是String時怎樣寫。
實現
<c:forEach items="${luxianList}" var="info">?<tr><td colspan="6" class="pass_width_ave_6_column">${info}</td></tr> </c:forEach>?
總結
以上是生活随笔為你收集整理的c:forEach循环的List为String时的写法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 一行Java代码实现将数组转成List
- 下一篇: Docker获取镜像并运行