public static final String splitPages2(int thePage, String queryString, int count,
int pageLength)
{
int maxPage = count / pageLength + 1;
int prevPage = thePage - 1;
if (prevPage 1)
{
(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/webkaifa/)prevPage = 1;
}
int nextPage = thePage + 1;
int showMaxPage = thePage + 6;
int spacePage = 1;
if (thePage 6)
{
(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/webkaifa/)spacePage = thePage - 5;
}
if (showMaxPage 10)
{
(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/webkaifa/)showMaxPage = 10;
}
//p class="fy"a class="back" href=""上一页/aa href=""01/aa href=""02/aa href=""03/aa class="next" href=""下一页/a/p
StringBuffer sb = new StringBuffer();
sb.append("p class="fy" a href=""+queryString+""第一页/a");
sb.append("a class="back" href="" + queryString + "&pagex=" + prevPage
+ ""上一页/a");
for (int i = spacePage; i showMaxPage && i = maxPage; i++)
{
(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/webkaifa/)String fontColor = "black";
if (i == thePage)
{
(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/webkaifa/)fontColor = "red";
}
sb.append("a href="" + queryString + "&pagex=" + i
+ ""font color=" + fontColor + "" + addzero(i, 2)
+ "/font/a");
}