export="offset,currentPageNumber=pageNumber"
scope="request">
<pg:param name="style"/>
<pg:param name="position"/>
<pg:param name="index"/>
<pg:param name="maxPageItems"/>
<pg:param name="maxIndexPages"/>
<input type="hidden" name="pager.offset" value="<%= offset %>">
<%-- warn if offset is not a multiple of maxPageItems --%>
<% if (offset.intValue() % maxPageItems != 0 &&
("alltheweb".equals(style) || "lycos".equals(style)) )
{
%>
<p>Warning: The current page offset is not a multiple of Max. Page Items.
<br>Please
<pg:first><a href="<%= pageUrl %>">return to the first page</a></pg:first>
if any displayed range numbers appear incorrect.</p>
<% } %>
// 显示跳转的jsp;
<% if ("top".equals(position) || "both".equals(position)) { %>
<pg:index><jsp:include page="paging-links.jsp" flush="true"/></pg:index>
<% } %>
<% for(int i = 0; i <size; i++ ){%>
<pg:item>
<td> <%= list.get(i)%></td> // 简单的显示数据;
</pg:item>
<%
}
%>
</pg:pager>
5. paging-links.jsp 如下:或者参照jsptags中的示范copy你所需要的显示格式
<%@ page session="false" %>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager " prefix="pg" %>
<table width=100% cellpadding=2 cellspacing=0 border=0 bgcolor=e3e9f8>
<tr><td><font face=arial size=2> <b>Matches</b></font>
</td><td align=right nowrap width=1%><font face=arial size=-1>
<pg:index export="total=itemCount">
<pg:page export="first,last">
<%= first %> - <%= last %> of <%= total %>
</pg:page>
<pg:first export="url" unless="current">
<b><a href="<%= url %>">First Page</a></b> |
</pg:first>
<pg:prev export="url,first,last">
<% int prevItems = (last.intValue() - first.intValue()) + 1; %>
<b><a href="<%= url %>">Previous <%= prevItems %></a></b>
</pg:prev>
<pg:next export="url,first,last">
<% int nextItems = (last.intValue() - first.intValue()) + 1; %>
| <b><a href="<%= url %>">Next <%= nextItems %></a></b>
</pg:next>
</font></td></tr>
</table>
</pg:index>