j分页技术代码奉献_JSP技巧_黑客防线网安服务器维护基地--Powered by WWW.RONGSEN.COM.CN

j分页技术代码奉献

作者:黑客防线网安JSP教程基地 来源:黑客防线网安JSP教程基地 浏览次数:0

本篇关键词:奉献代码技术 
黑客防线网安网讯:public static final String splitPages2(int thePage, String queryString, int count,                int pageLength)        {            int maxPage = count / pageLength + 1;     ...

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)

            {

                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="">上一页</a><a href="">01</a><a href="">02</a><a href="">03</a><a 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.rongsen.com.cn/show-16613-1.html
网站维护教程更新时间:2012-04-07 00:43:46  【打印此页】  【关闭
我要申请本站N点 | 黑客防线官网 |  
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479

footer  footer  footer  footer