每个人都希望每天都是开心的,不要因为一些琐事扰乱了心情还,闲暇的时间怎么打发,关注图老师可以让你学习更多的好东西,下面为大家推荐jsp分页技术代码奉献,赶紧看过来吧!
【 tulaoshi.com - Web开发 】
public static final String splitPages2(int thePage, String queryString, int count,
int pageLength)
{
int maxPage = count / pageLength + 1;
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/webkaifa/)int prevPage = thePage - 1;
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/webkaifa/)if (prevPage 1)
{
prevPage = 1;
}
int nextPage = thePage + 1;
int showMaxPage = thePage + 6;
int spacePage = 1;
if (thePage 6)
{
spacePage = thePage - 5;
}
if (showMaxPage 10)
{
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++)
{
String fontColor = "black";
if (i == thePage)
{
fontColor = "red";
}
sb.append("a href="" + queryString + "&pagex=" + i
+ ""font color=" + fontColor + "" + addzero(i, 2)
+ "/font/a");
}
来源:http://www.tulaoshi.com/n/20160219/1609157.html