c:forEach循环的List为String时的写法
生活随笔
收集整理的這篇文章主要介紹了
c:forEach循环的List为String时的写法
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
場(chǎng)景
使用<c:forEach標(biāo)簽時(shí)通常是遍歷對(duì)象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>當(dāng)遍歷的List不是對(duì)象,而是String時(shí)怎樣寫。
實(shí)現(xiàn)
<c:forEach items="${luxianList}" var="info">?<tr><td colspan="6" class="pass_width_ave_6_column">${info}</td></tr> </c:forEach>?
總結(jié)
以上是生活随笔為你收集整理的c:forEach循环的List为String时的写法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 一行Java代码实现将数组转成List
- 下一篇: Docker获取镜像并运行