预览加载中,请您耐心等待几秒...
1/8
2/8
3/8
4/8
5/8
6/8
7/8
8/8

在线预览结束,喜欢就下载吧,查找使用更方便

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

JSP分页 本文封装JSP常规分页,实现快速分页开发,见代码: /** *@author张锦 *@version1.0 *createtime2012-8-31下午03:55:39 */ packagecom.lmd.util; importjava.io.IOException; importjava.util.List; importjavax.servlet.jsp.JspWriter; importorg.apache.log4j.Logger; /** *说明 *@author张锦 *@version1.0 *datetime2012-8-31下午03:55:39 */ publicclassPage{ privatestaticfinalLoggerlog=Logger.getLogger(Page.class); privateintpageSize=15;//当前页面记录数 privateintcurrnetPageNumber=1;//当前页码(从1开始) privateintcountNum=0;//总记录数 privateListdata;//当前页面数据 privateinttotalPage=0;//页码总数 privatebooleanmemoryPage=false;//是否为内存分页 privateListtotalData;//总记录,只有为内存分页的时候才有用 privateintfontSize=2;//分页条字体大小 publicPage(intcountNum,intpageSize,Listdata){ this.countNum=countNum; this.pageSize=pageSize; this.data=data; } publicPage(intcountNum,Listdata){ this.countNum=countNum; this.data=data; } publicPage(Listtotaldata,booleanmemoryPage,intpageSize){ this.pageSize=pageSize; this.totalData=totaldata; this.memoryPage=memoryPage; this.countNum=totaldata.size(); } publicPage(){ } publicintgetFontSize(){ returnfontSize; } publicvoidsetFontSize(intfontSize){ this.fontSize=fontSize; } publicintgetPageSize(){ returnpageSize; } publicvoidsetPageSize(intpageSize){ if(pageSize<=0){ this.pageSize=15; return; } this.pageSize=pageSize; } publicbooleanisMemoryPage(){ returnmemoryPage; } publicvoidsetMemoryPage(booleanmemoryPage){ this.memoryPage=memoryPage; } publicListgetTotalData(){ returntotalData; } publicvoidsetTotalData(ListtotalData){ this.totalData=totalData; } /** * *获取当前页码 *@returnint */ publicintgetCurrnetPageNumber(){ if(this.currnetPageNumber<=1){ return1; } if(this.currnetPageNumber>this.getTotalPage()){ returnthis.getTotalPage(); } returnthis.currnetPageNumber; } publicvoidsetCurrnetPageNumber(StringcurrnetPageNumber){ log.info(currnetPageNumber); if(null==currnetPageNumber||"".equals(currnetPageNumber)){ this.currnetPageNumber=1; return; } intcpn=newInteger(currnetPageNumber).intValue(); if(cpn>=t