使用struts的logic:iterate标签遍历列表时得到显示序号

<logic:notEmpty name="sList" scope="request">
    <logic:iterate id="element" indexId="index" name="sList">
        <tr>
            <td width="50"><%= index.intValue() + 1 %>.</td>
            <td><bean:write name="element"/></td>
        </tr>
    </logic:iterate>
</logic:notEmpty>

关键是indexId="index"<%= index.intValue() + 1 %> 两部分。

原文地址:https://www.cnblogs.com/heyang78/p/6259698.html