使用struts的logic:iterate标签遍历列表时得到显示序号时间:2023-03-09 16:42:49 <logic:notEmpty name="sList" scope="request"> <logic:iterate id="element" indexId="index" name="sList"> <tr> %>.</td> <td><bean:write name="element"/></td> </tr> </logic:iterate> </logic:notEmpty> 关键是indexId="index" 和<%= index.intValue() + 1 %> 两部分。