我正在尝试在每次迭代之间使用separador。问题是在最后一次迭代中我离开了最后一个//
示例:18000→32768 // 22→32769 //
我想:18000→32768 // 22→32769
<c:forEach var="port" items="${container.ports}">
${port.privatePort} → ${port.publicPort} //
</c:forEach>
答案 0 :(得分:0)
尝试一下:
<c:forEach var="port" items="${container.ports}">
<c:when test=”${not status.last}”>
${port.privatePort} → ${port.publicPort} //
</c:when>
<c:otherwise>
${port.privatePort} → ${port.publicPort}
</c:otherwise>
</c:forEach>
或者:
<c:forEach var="port" items="${container.ports}">
${port.privatePort} → ${port.publicPort} <c:if test="${!loop.last}">//</c:if>
</c:forEach>