-2

我需要在 jsp 页面上为对象列表创建分页,因此我只需要遍历一系列索引。

4

1 回答 1

1

认为

class Person {
  int age;
  String name;
}

personList 是人员列表。然后你可以像这样迭代......

<c:forEach var="person" items="${personList}" varStatus="status">
         <c:if test="${status.index >= startIndex && status.index < endIndex}">      
             ${person}
         </c:if>
</c:forEach>
于 2013-05-18T18:55:40.193 回答