我需要分页概念来显示 15 条记录。这是我的jsp文件。
<%
ArrayList<String> al = new ArrayList();
%>
<%!String s;
int i;%>
<%
al = op.getCountry();
%>
<jsp:scriptlet>
session.setAttribute( "EmpList", al);
</jsp:scriptlet>
<display:table id="domList" pagesize="10" name="sessionScope.EmpList">
<table width="100%" border="0" cellpadding="0" cellspacing="0" id="dataTable">
<tr bgcolor="#57e3ff">
<td><strong>Country</strong></td>
<td colspan="2" align="center"><strong>Action</strong></td>
</tr>
<% int a = 0, i = 0;
while (i < al.size()) {
if ((i + 1) % 2 == 0) {
s = "#f3f4f4";
} else {
s = "#ebebec";
}%>
<tr bgcolor="<%=s%>">
<td><display:column value="<%=al.get(i)%>" /> </td>
<td align="center"><div id='basic-modal-cdel'>
<a href='#' id="<%=al.get(i)%>" onclick="return del();"
class='basic-cdel'><img src="${pageContext.request.contextPath}/images/delete.png"
alt="Delete" title="Delete" border="0" /></a>
</div></td>
<td align="center"><div id='basic-modal-country'>
<a href='#' id="<%=al.get(i)%>" class='basic-country'
onclick="validatedit()"><img src="${pageContext.request.contextPath}/images/edit-icon.png"
alt="Update" title="Update" border="0" /></a>
</div></td>
</tr>
<%
i++;
a++;
}
%>
请帮助我是分页新手。我只想每页显示 10 条记录。我通过显示标签尝试了它,但我无法弄清楚。