if (page.getItems().isEmpty()) {
result.append("没有数据");
} else {
int pageNo = page.getPageNo();
int pageCount = page.getPageCount();
StrutsUtil strutsUtil = new StrutsUtil(TagUtils.getStack(pageContext), (HttpServletRequest) pageContext.getRequest(), (HttpServletResponse) pageContext.getResponse());
result.append("<script type=\"text/javascript\">function goPage(pageNo) { document.getElementById('pagination.pageNo').value=pageNo; document.getElementById('" + formName + "').submit(); }</script>");
result.append("<input type=\"hidden\" id=\"pagination.pageNo\" name=\"pagination.pageNo\" value=\"" + page.getPageNo() + "\" />");
result.append("<input type=\"hidden\" id=\"pagination.pageSize\" name=\"pagination.pageSize\" value=\"" + page.getPageSize() + "\" />");
result.append("<div class=\"row-fluid\">");
result.append("<div class=\"span12\">");
result.append("<div class=\"dataTables_info\" id=\"DataTables_Table_0_info\">");
result.append(strutsUtil.getText("pageTag.di"));
result.append(pageNo);
result.append(strutsUtil.getText("pageTag.ye") + " ");
result.append(strutsUtil.getText("pageTag.gong"));
result.append(pageCount);
result.append(strutsUtil.getText("pageTag.ye"));
result.append("</div>");
result.append("</div>");
result.append("<div class=\"span12 center\">");
result.append("<div class=\"dataTables_paginate paging_bootstrap pagination\">");
result.append("<ul>");
if (page.isHasPre()) {
result.append("<li class=\"prev\"><a href=\"javascript:goPage(1);\"><< " + strutsUtil.getText("pageTag.shouye") + "</a></li>");
result.append("<li class=\"prev\"><a href=\"javascript:goPage(" + page.getPrePage() + ");\">< " + strutsUtil.getText("pageTag.qianye") + "</a></li>");
} else {
result.append("<li class=\"prev disabled\"><a href=\"javascript:void(0);\"><< " + strutsUtil.getText("pageTag.shouye") + "</a></li>");
result.append("<li class=\"prev disabled\"><a href=\"javascript:void(0);\">< " + strutsUtil.getText("pageTag.qianye") + "</a></li>");
}
//显示当前页的前3页到当前页的后3页,最后7页
TreeSet<Integer> pageNos = new TreeSet<Integer>();
for (int i = pageNo - 3; i < pageNo + 4; i++) {
if (i > 0 && i < pageCount + 1) {
pageNos.add(i);
}
}
appendPageNos(pageNos, pageNo, page, result);
if (page.isHasNext()) {
result.append("<li class=\"next\"><a href=\"javascript:goPage(" + page.getNextPage() + ");\">" + strutsUtil.getText("pageTag.houye") + " ></a></li>");
result.append("<li class=\"next\"><a href=\"javascript:goPage(" + page.getPageCount() + ");\">" + strutsUtil.getText("pageTag.weiye") + " >></a></li>");
} else {
result.append("<li class=\"next disabled\"><a href=\"javascript:void(0);\">" + strutsUtil.getText("pageTag.houye") + " ></a></li>");
result.append("<li class=\"next disabled\"><a href=\"javascript:void(0);\">" + strutsUtil.getText("pageTag.weiye") + " >></a></li>");
}
result.append("</ul>");
result.append("</div>");
result.append("</div>");
result.append("</div>");