jsp <s:iterator>遍历表格中中添加序号

写jsp文件的时候从后台遍历表格,想添加一个自增的序号列,一直找不到方法,通过JAVA写循环函数又有点费劲,网上搜了一个可用直接用的方法,不需要后台查询实现

<tr id="title">
<th width="2%">

<input type="checkbox" name="selectAll" title="全选/取消全选" id="selectAll" style="cursor:hand" onclick="ck()"/></th>
    <th  width="2%">序号</th>
    <th  width="5%">项目号</th>
    <th  width="5%">项目名称</th>

</tr>

</thead>
<tbody>
 <s:iterator value="u5List" var="obj" status="stuts">
 <tr onclick="selectRow('<s:property value="ID"/>')">
    <td><input type="checkbox" name="idArr" value="<s:property value="ID"/>"/> </td>
    <td><s:property value="#stuts.count"/></td> 
    <td><s:property value="projectID"/>&nbsp;</td>
    <td><s:property value="projectName"/>&nbsp;</td>

 </tr>

 </s:iterator>

<tbody>

猜你喜欢

转载自liuqian-1943-126-com.iteye.com/blog/2246116