Posted on 2008-03-09 12:13
G_G 阅读(1012)
评论(2) 编辑 收藏 所属分类:
JspTag
使用标签 这是以 get 提交
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>
<div align="center" id="bgee">
<pg:pager id="pager"
url='bonusdetailaction.do'
items='<%=max%>'
maxPageItems='10'
export="offset,currentPageNumber=pageNumber"
isOffset="false"
scope="request">
<pg:index>
<pg:prev> <a href="<%= response.encodeURL(pageUrl.replaceAll("&", "&")) %>&method=paginationEnquiries&rId=<%=request.getAttribute("rId") %>">[上一页]</a></pg:prev>
<pg:pages export="pageUrl, pageNumber">
<%
if (pageNumber == currentPageNumber) {
%>
<b><%= pageNumber %></b>
<%
} else {
%>
<a href="<%= response.encodeURL(pageUrl.replaceAll("&", "&")) %>&method=paginationEnquiries&rId=<%=request.getAttribute("rId") %>"><%= pageNumber %></a>
<%
}
%>
</pg:pages>
<pg:next><a href="<%= response.encodeURL(pageUrl.replaceAll("&", "&")) %>&method=paginationEnquiries&rId=<%=request.getAttribute("rId") %>">[下一页]</a></pg:next>
</pg:index>
</pg:pager>
</div>
action
int startNum = getParam(request, "pageroffset", 0);
int itms = getParam(request, "maxPageItems", 10);
dao
Query qu = session.createQuery(hql).setLong("rid", rw.getId());
qu.setFirstResult(start);
qu.setMaxResults(itms );