分页显示中关于"序号"的问题

项目开发中要求列表显示要明显看到总条目数,所以就要求序号从1开始。

如下为从1开始的序号展示:

<s:iterator value="#request.pageView.records" var="model" status="stat">

<tr>

<td width="20%">${(request.pageView.currentpage-1)*request.pageView.maxresult+stat.count}</td>

</tr>

</s:iterator>

currentpage:表示当前页码

maxresult:每页显示条数

stat.count:iterator的索引为stat.index(从0开始),stat.count(从1开始)。

原文地址:https://www.cnblogs.com/Crysta1/p/6178737.html