项目开发中经常会遇到翻页展示需求,于是自己利用Struts2的自定义标签写了一个翻页标签。
首先标签主体部分如下:
/**
*
* 翻页标签
*
* <br/>
* <font size="1" color="red">备注:</font><br/>
* 页面列表的翻页统一格式
*
* @author $Author: hong.li $
* @Date: $Date: 2012-10-24 15:00:34 +0800 (星期三, 24 十月 2012) $
* @Id: $Id: PaginationTag.java 9229 2012-10-24 07:00:34Z hong.li $
* @LastChangedRevision: $LastChangedRevision: 9229 $
*/
public class PaginationTag extends TagSupport {
private static final long serialVersionUID = 8596112830211782236L;
private String preLabel;
private String nextLabel;
private String firstLabel;
private String lastLabel;
private String totalPagesLabel;
private String totalCountLabel;
private String totalCountLabel2;
private String totalCountLabel3;
private String includes;
private String optionId = "paginationOption";
private int totalCount = 0;
private int perPageSize = 20;
private int totalPages = -1;
private int page = 1;
// private boolean styleNumber = true;
private String jsMethod;
public String getJsMethod() {
return jsMethod;
}
private boolean styleOption = false;
private String reqUrl;
public String getReqUrl() {
return reqUrl;
}
public void setReqUrl(String reqUrl) {
this.reqUrl = reqUrl;
}
/**
* @return the totalCountLabel
*/
public String getTotalCountLabel() {
return totalCountLabel;
}
/**
* @param totalCountLabel
* the totalCountLabel to set
*/
public void setTotalCountLabel(String totalCountLabel) {
this.totalCountLabel = totalCountLabel;
}
/**
* @return the totalCountLabel2
*/
public String getTotalCountLabel2() {
return totalCountLabel2;
}
/**
* @param totalCountLabel2
* the totalCountLabel2 to set
*/
public void setTotalCountLabel2(String totalCountLabel2) {
this.totalCountLabel2 = totalCountLabel2;
}
/**
* @return the totalPagesLabel
*/
public String getTotalPagesLabel() {
return totalPagesLabel;
}
/**
* @param totalPagesLabel
* the totalPagesLabel to set
*/
public void setTotalPagesLabel(String totalPagesLabel) {
this.totalPagesLabel = totalPagesLabel;
}
private Map<String, Object> ftKeys = new HashMap<String, Object>();
/**
* The servlet context attribute key for our resources.
*/
protected String bundle = null;
/**
* The session scope key under which our Locale is stored.
*/
/**
* Release any acquired resources.
*/
public void release() {
super.release();
preLabel = null;
nextLabel = null;
firstLabel = null;
lastLabel = null;
styleOption = false;
jsMethod = null;
reqUrl = null;
includes = null;
totalCount = 0;
perPageSize = 20;
totalPages = 1;
page = 1;
ftKeys.clear();
}
public String getBundle() {
return bundle;
}
public void setBundle(String bundle) {
this.bundle = bundle;
}
private void initReqUrl() {
if (ValidateUtil.isEmpty(reqUrl)) {
Map<String, Object> cont = TagUtils.getStack(pageContext).getContext();
StrutsRequestWrapper req = (StrutsRequestWrapper) cont.get(StrutsStatics.HTTP_REQUEST);
reqUrl = (String) req.getAttribute("javax.servlet.forward.request_uri");
if (reqUrl != null) reqUrl = HtmlUtil.escapeHTML(reqUrl);
ftKeys.put("reqUrl", reqUrl);
} else {
ftKeys.put("reqUrl", HtmlUtil.escapeHTML(reqUrl));
}
}
private void initRequestParm() {
StringBuilder requestParm = new StringBuilder("");
if (includes != null && includes.trim().length() > 0) {
String[] perm = includes.split(",");
for (int i = 0; i < perm.length; i++) {
String permName = perm[i];
Object obje = TagUtils.getStack(pageContext).findValue(permName);
requestParm.append("/");
if (null == obje || "null".equalsIgnoreCase(String.valueOf(obje))) {
requestParm.append("null");
} else {
// requestParm.append( permName );
// requestParm.append( "-" );
requestParm.append(obje);
}
}
}
String paramsStr = requestParm.toString();
ftKeys.put("requestParm", HtmlUtil.escapeHTML(paramsStr));
}
private void initTotalPagesLabel() throws JspException {
if (ValidateUtil.isNotEmpty(totalPagesLabel)) {
String message = TagUtils.getStack(pageContext).findString(totalPagesLabel);
if (ValidateUtil.isNotEmpty(message)) {
totalPagesLabel = HtmlUtil.escapeHTML(message);
}
ftKeys.put("totalPagesLabel", totalPagesLabel);
}
}
private void initTotalCountLabel() throws JspException {
if (ValidateUtil.isNotEmpty(totalCountLabel)) {
String message = TagUtils.getStack(pageContext).findString(totalCountLabel);
if (ValidateUtil.isNotEmpty(message)) {
totalCountLabel = HtmlUtil.escapeHTML(message);
}
ftKeys.put("totalCountLabel", totalCountLabel);
}
}
private void initTotalCountLabel2() throws JspException {
if (ValidateUtil.isNotEmpty(totalCountLabel2)) {
String message = TagUtils.getStack(pageContext).findString(totalCountLabel2);
if (ValidateUtil.isNotEmpty(message)) {
totalCountLabel2 = HtmlUtil.escapeHTML(message);
}
ftKeys.put("totalCountLabel2", totalCountLabel2);
}
}
private void initTotalCountLabel3() throws JspException {
if (ValidateUtil.isNotEmpty(totalCountLabel3)) {
String message = TagUtils.getStack(pageContext).findString(totalCountLabel3);
if (ValidateUtil.isNotEmpty(message)) {
totalCountLabel3 = HtmlUtil.escapeHTML(message);
}
ftKeys.put("totalCountLabel3", totalCountLabel3);
}
}
private void prefixPage() throws JspException {
if (ValidateUtil.isNotEmpty(firstLabel)) {
// Retrieve the message string we are looking for
String message = TagUtils.getStack(pageContext).findString(firstLabel);
if (ValidateUtil.isNotEmpty(message)) {
firstLabel = HtmlUtil.escapeHTML(message);
}
ftKeys.put("firstLabel", firstLabel);
}
if (ValidateUtil.isNotEmpty(preLabel)) {
String message = TagUtils.getStack(pageContext).findString(preLabel);
if (ValidateUtil.isNotEmpty(message)) {
preLabel = HtmlUtil.escapeHTML(message);
}
ftKeys.put("preLabel", preLabel);
ftKeys.put("prePage", ((page - 1 > 0) ? page - 1 : 1));
}
}
private void suffixPage() throws JspException {
// StringBuffer sb = new StringBuffer("");
if (ValidateUtil.isNotEmpty(nextLabel)) {
String message = TagUtils.getStack(pageContext).findString(nextLabel);
if (ValidateUtil.isNotEmpty(message)) {
nextLabel = HtmlUtil.escapeHTML(message);
}
ftKeys.put("nextLabel", nextLabel);
ftKeys.put("nextPage", ((page + 1 <= totalPages) ? page + 1 : totalPages));
}
if (ValidateUtil.isNotEmpty(lastLabel)) {
String message = TagUtils.getStack(pageContext).findString(lastLabel);
if (ValidateUtil.isNotEmpty(message)) {
lastLabel = HtmlUtil.escapeHTML(message);
}
ftKeys.put("lastLabel", lastLabel);
}
}
/**
* Write the specified text as the response to the writer associated with
* this page. <strong>WARNING</strong> - If you are writing body content
* from the <code>doAfterBody()</code> method of a custom tag class that
* implements <code>BodyTag</code>, you should be calling
* <code>writePrevious()</code> instead.
*
* @param pageContext
* The PageContext object for this page
* @param text
* The text to be written
* @throws JspException
* if an input/output error occurs (already saved)
*/
public void write(PageContext pageContext, String text) throws JspException {
JspWriter writer = pageContext.getOut();
try {
writer.print(text);
} catch (IOException e) {
throw new JspException("write.io" + e.toString());
}
}
/**
* Process the end of this tag.
*
* @throws JspException
* if a JSP exception has occurred
*/
public int doStartTag() throws JspException {
totalPages = this.getTotalPages();
ftKeys.put("totalPages", totalPages);
ftKeys.put("totalCount", totalCount);
ftKeys.put("page", page);
ftKeys.put("jsMethod", jsMethod);
ftKeys.put("styleOption", styleOption);
prefixPage();
suffixPage();
initTotalPagesLabel();
initTotalCountLabel();
initTotalCountLabel2();
initTotalCountLabel3();
initRequestParm();
initReqUrl();
if (styleOption) {
ftKeys.put("optionId", optionId);
}
String ret = _generatePaginationContent();
this.write(pageContext, ret);
// Evaluate the remainder of this page
return (SKIP_BODY);
}
/**
* 生成标签
*
* @author lih
* @return 标签字符串
*/
public String _generatePaginationContent() {
StringBuffer sb = new StringBuffer();
String requestParm = (String) ftKeys.get("requestParm");
sb.append("<div id=\"pagination\" class=\"page\">");
if (ValidateUtil.isNotEmpty(totalCountLabel)) {
sb.append("<span class=\"toatalCount\">");
sb.append(totalCountLabel);
if (ValidateUtil.isNotEmpty(totalCountLabel2)) {
if (totalCount > page * perPageSize) {
sb.append((page - 1) * perPageSize + 1).append("-").append(page * perPageSize);
} else if (totalCount == 0) {
sb.append(totalCount);
} else {
sb.append((page - 1) * perPageSize + 1).append("-").append(totalCount);
}
sb.append(ftKeys.get("totalCountLabel2"));
}
sb.append("<span class='color_black'>").append(totalCount).append("</span>");
sb.append(totalCountLabel3);
sb.append("</span>");
}
if (ValidateUtil.isNotEmpty(totalPagesLabel)) {
sb.append("<span class=\"toatalPages\">").append(totalPagesLabel).append(":").append(totalPages);
sb.append("</span>");
}
if (totalPages != 0) {
if (ValidateUtil.isNotEmpty(firstLabel)) {
if (page > 1) {
if (ValidateUtil.isNotEmpty(jsMethod)) {
sb.append("<span class=\"firstPage\"><a href=\"javascript:").append(jsMethod).append("(1);\">").append(ftKeys.get("firstLabel")).append("</a></span>");
} else {
sb.append("<span class=\"firstPage\"><a href=\"").append(ftKeys.get("reqUrl")).append("/1").append(requestParm).append("\">");
sb.append(" ").append(ftKeys.get("firstLabel")).append("</a></span>");
}
} else {
sb.append("<span class=\"prePage\"><span class=\"disable_page\">").append(" ").append(ftKeys.get("firstLabel")).append("</span></span> ");
}
}
if (ValidateUtil.isNotEmpty(preLabel)) {
if (page > 1) {
int t_page = page - 1;
if (ValidateUtil.isNotEmpty(jsMethod)) {
sb.append("<span class=\"prePage\"><a οnfοcus=\"this.blur()\" href=\"javascript:").append(jsMethod).append("(").append(t_page).append(");\">").append(ftKeys.get("preLabel"))
.append("</a></span> ");
} else {
sb.append(" <span class=\"prePage\"><a οnfοcus=\"this.blur()\" href=\"").append(ftKeys.get("reqUrl")).append("/").append(t_page).append("/").append(requestParm).append("\">")
.append(ftKeys.get("preLabel")).append("</a></span> ");
}
} else {
sb.append("<span class=\"prePage\"><span class=\"disable_page\">").append(ftKeys.get("preLabel")).append("</span></span>");
}
}
}
if (styleOption) {
sb.append("<select id=\"").append(ftKeys.get("optionId")).append("\" name=\"").append(ftKeys.get("optionId")).append("\" οnchange=\"").append(jsMethod)
.append("(this.options[this.selectedIndex].value)\">");
for (int tpage = 1; tpage < totalPages; tpage++) {
if (tpage == page) {
sb.append("<option value=\"").append(tpage).append("\" selected>").append(tpage).append("</option>");
} else {
sb.append("<option value=\"").append(tpage).append("\">").append(tpage).append("</option>");
}
}
}
if ((totalPages >= 0) && (totalPages < 11)) {
for (int pg = 1; pg <= totalPages; pg++) {
if (pg == page) {
sb.append("<span class=\"current\" style=\"margin-left: 5px; \"> ").append(pg).append("</span>");
} else if ((pg > 0) && (pg <= totalPages)) {
if (ValidateUtil.isNotEmpty(jsMethod)) {
sb.append(" <a href=\"javascript:").append(jsMethod).append("(").append(pg).append(");\">").append(pg).append("</a>");
} else {
sb.append("<a href=\"").append(ftKeys.get("reqUrl")).append("/").append(pg).append(requestParm).append("\">").append(pg).append("</a>");
}
}
}
} else {
if ((page < 6)) {
for (int pg = 1; pg < 10; pg++) {
if (pg == page) {
sb.append("<span class=\"current\" style=\"margin-left: 5px; \">").append(pg).append("</span>");
} else if ((pg > 0) && (pg <= totalPages)) {
if (ValidateUtil.isNotEmpty(jsMethod)) {
sb.append("<a href=\"javascript:").append(jsMethod).append("(").append(pg).append(");\">").append(pg).append("</a>");
} else {
sb.append("<a href=\"").append(ftKeys.get("reqUrl")).append("/").append(pg).append(requestParm).append("\">").append(pg).append("</a>");
}
}
}
if ((totalPages >= 11)) {
sb.append("...");
}
} else if (((page + 5) > totalPages)) {
for (int pg = totalPages - 9; pg <= totalPages; pg++) {
if (pg == page) {
sb.append("<span class=\"current\" style=\"margin-left: 5px; \"> ").append(pg).append("</span>");
} else if ((pg > 0) && (pg <= totalPages)) {
if (ValidateUtil.isNotEmpty(jsMethod)) {
sb.append("<a href=\"javascript:").append(jsMethod).append("(").append(pg).append(");\">").append(pg).append("</a>");
} else {
sb.append("<a href=\"").append(ftKeys.get("reqUrl")).append("/").append(pg).append(requestParm).append("\">").append(pg).append("</a>");
}
}
}
} else {
for (int pg = page - 5; pg < page + 4; pg++) {
if (pg == page) {
sb.append("<span class=\"current\" style=\"margin-left: 5px; \"> ").append(pg).append("</span>");
} else if ((pg > 0) && (pg <= totalPages)) {
if (ValidateUtil.isNotEmpty(jsMethod)) {
sb.append("<a href=\"javascript:").append(jsMethod).append("(").append(pg).append(");\">").append(pg).append("</a>");
} else {
sb.append("<a href=\"").append(ftKeys.get("reqUrl")).append("/").append(pg).append(requestParm).append("\">").append(pg).append("</a>");
}
}
}
sb.append("...");
}
}
if (totalPages != 0) {
if (ValidateUtil.isNotEmpty(nextLabel)) {
if ((page < totalPages)) {
int t_page = page + 1;
if (ValidateUtil.isNotEmpty(jsMethod)) {
sb.append("<span class=\"nextPage\"><a href=\"javascript:").append(jsMethod).append("(").append(t_page).append(");\">").append(ftKeys.get("nextLabel")).append("</a></span>");
} else {
sb.append("<span class=\"nextPage\"><a οnfοcus=\"this.blur()\" href=\"").append(ftKeys.get("reqUrl")).append("/").append(t_page).append(requestParm).append("\">")
.append(ftKeys.get("nextLabel")).append("</a></span>");
}
} else {
sb.append("<span class=\"nextPage\"><span class=\"disable_page\"> ").append(ftKeys.get("nextLabel")).append("</span></span>");
}
}
if (ValidateUtil.isNotEmpty(lastLabel)) {
if ((page < totalPages)) {
if (ValidateUtil.isNotEmpty(jsMethod)) {
sb.append(" <span class=\"lastPage\"><a href=\"javascript:").append(jsMethod).append("(").append(totalPages).append(");\">").append(ftKeys.get("lastLabel"))
.append("</a></span>");
} else {
sb.append(" <span class=\"lastPage\"><a href=\"" + ftKeys.get("reqUrl") + "/").append(jsMethod).append(totalPages).append(ftKeys.get("requestParm")).append("\">")
.append(ftKeys.get("lastLabel")).append("</a></span>");
}
} else {
sb.append("<span class=\"nextPage\"><span class=\"disable_page\"> ").append(ftKeys.get("lastLabel")).append("</span></span>");
}
}
}
sb.append("</div>");
return sb.toString();
}
/**
* @return the totalPages
*/
public int getTotalPages() {
if (totalPages < 0) {
int ret = 1;
if (totalCount > perPageSize) ret = (int) Math.ceil(((double) totalCount) / perPageSize);
return ret;
} else {
return totalPages;
}
}
/**
* @param totalPages
* the totalPages to set
*/
public void setTotalPages(int totalPages) {
this.totalPages = totalPages;
}
/**
* @return the preLabel
*/
public String getPreLabel() {
return preLabel;
}
/**
* @param preLabel
* the preLabel to set
*/
public void setPreLabel(String preLabel) {
this.preLabel = HtmlUtil.escapeHTML(preLabel);
}
/**
* @return the nextLabel
*/
public String getNextLabel() {
return nextLabel;
}
/**
* @param nextLabel
* the nextLabel to set
*/
public void setNextLabel(String nextLabel) {
this.nextLabel = HtmlUtil.escapeHTML(nextLabel);
}
/**
* @return the totalCount
*/
public int getTotalCount() {
return totalCount;
}
/**
* @param totalCount
* the totalCount to set
*/
public void setTotalCount(int totalCount) {
if (totalCount > -1) this.totalCount = totalCount;
}
/**
* @return the perPageSize
*/
public int getPerPageSize() {
return perPageSize;
}
/**
* @param perPageSize
* the perPageSize to set
*/
public void setPerPageSize(int perPageSize) {
if (perPageSize > 0) this.perPageSize = perPageSize;
}
/**
* @return the page
*/
public int getPage() {
return page;
}
/**
* @param page
* the page to set
*/
public void setPage(int page) {
this.page = page;
}
/**
* @return the styleOption
*/
public boolean isStyleOption() {
return styleOption;
}
/**
* @param styleOption
* the styleOption to set
*/
public void setStyleOption(boolean styleOption) {
this.styleOption = styleOption;
}
/**
* @param firstLabel
* the firstLabel to set
*/
public void setFirstLabel(String firstLabel) {
this.firstLabel = HtmlUtil.escapeHTML(firstLabel);
}
/**
* @param lastLabel
* the lastLabel to set
*/
public void setLastLabel(String lastLabel) {
this.lastLabel = HtmlUtil.escapeHTML(lastLabel);
}
/**
* @param optionId
* the optionId to set
*/
public void setOptionId(String optionId) {
this.optionId = HtmlUtil.escapeHTML(optionId);
}
/**
* @param jsMethod
* the jsMethod to set
*/
public void setJsMethod(String jsMethod) {
this.jsMethod = HtmlUtil.escapeHTML(jsMethod);
}
public String getIncludes() {
return includes;
}
public void setIncludes(String includes) {
this.includes = includes;
}
/**
* @param totalCountLabel3
* the totalCountLabel3 to set
*/
public void setTotalCountLabel3(String totalCountLabel3) {
this.totalCountLabel3 = totalCountLabel3;
}
}
然后编辑tld标签内容:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd">
<display-name>"Intopay Tags"</display-name>
<tlib-version>1.0</tlib-version>
<short-name>hli</short-name>
<uri>/hli-tags</uri>
<tag>
<name>pages</name>
<tag-class>com.hli.cmexico.pub.tags.PaginationTag</tag-class>
<body-content>empty</body-content>
<attribute>
<description>下一页标签</description>
<name>nextLabel</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>jsMethod</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<type>String</type>
</attribute>
<attribute>
<description>当前页</description>
<name>page</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>每页的记录数</description>
<name>perPageSize</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>前一页标签</description>
<name>preLabel</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>总记录数</description>
<name>totalCount</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>记录总数标签</description>
<name>totalCountLabel</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>总页数</description>
<name>totalPages</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>总页数标签</description>
<name>totalPagesLabel</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>是否使用样式</description>
<name>styleOption</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>传递的分页参数</description>
<name>includes</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>请求的URL</description>
<name>reqUrl</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>传递的第一个Label描述</description>
<name>firstLabel</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>传递的最后一个Label描述</description>
<name>lastLabel</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>传递总数的Label中间描述</description>
<name>totalCountLabel2</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>传递总数的Label描述</description>
<name>totalCountLabel3</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
</taglib>
下面构造翻页实体:
/**
*
* 翻页组件类<br/>
* 页面展示翻页部分需 返回此对象
*
* <br/>
*
* @author hong.li
*
*
*/
public class Pagination<T> implements Serializable {
private static final long serialVersionUID = 4608937638331221052L;
private int totalRecords;// 总记录数
private int currentPage;// 当前页码
private int pageSize;// 每页显示数据条数
private int totalPages;// 总页数
private List<T> entityList;// 实体集合
public Pagination() {
}
/**
* 构造翻页对象
*
* @param totalRecords
* 总记录数
* @param pageSize
* 每页显示数据数
* @param currentPage
* 当前页码
*/
public Pagination(int totalRecords, int pageSize, int currentPage) {
this.totalRecords = totalRecords;
this.pageSize = pageSize;
this.currentPage = currentPage;
this.totalPages = 1;
if (this.totalRecords != this.pageSize) {
if (this.totalRecords % this.pageSize == 0) {
this.totalPages = this.totalRecords / this.pageSize;
} else {
this.totalPages = this.totalRecords / this.pageSize + 1;
}
}
}
/**
* @return the totalRecords
*/
public int getTotalRecords() {
return totalRecords;
}
/**
* @param totalRecords
* the totalRecords to set
*/
public void setTotalRecords(int totalRecords) {
this.totalRecords = totalRecords;
}
/**
* @return the currentPage
*/
public int getCurrentPage() {
return currentPage;
}
/**
* @param currentPage
* the currentPage to set
*/
public void setCurrentPage(int currentPage) {
this.currentPage = currentPage;
}
/**
* @return the pageSize
*/
public int getPageSize() {
return pageSize;
}
/**
* @param pageSize
* the pageSize to set
*/
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
/**
* @return the totalPages
*/
public int getTotalPages() {
return this.totalPages;
}
/**
* @param totalPages
* the totalPages to set
*/
public void setTotalPages(int totalPages) {
this.totalPages = totalPages;
}
/**
* @return the entityList
*/
public List<T> getEntityList() {
return entityList;
}
/**
* @param entityList
* the entityList to set
*/
public void setEntityList(List<T> entityList) {
this.entityList = entityList;
}
}
先引入标签库文件
<%@taglib uri="/hli-tags" prefix="ls"%>
使用标签
<ls:pages firstLabel="首页" lastLabel="尾页" jsMethod="goPage" totalCountLabel="第 <span class='color_black'>" totalCountLabel2="</span> 条,共 " totalCountLabel3=" 条"
totalCount="${pagination.totalRecords }" totalPages="${pagination.totalPages }" page="${pagination.currentPage }" perPageSize="${pagination.pageSize }" preLabel="上一页"
nextLabel="下一页" />