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

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

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

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

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

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

MyHibernate3分页标签使用文档 MyHibernate3分页标签(1)—pageController2分页核心控制器 packagezjnu.soft.util; //策略:查多少分多少 publicclasspageController2{ privateintcurrentPageIndex;//当前页码 privateintcountPerpage;//每页多少条记录 privateintpageCount;//页数 privateintrecordCount;//记录总条数 privateintprePageIndex;//上一页序号 privateintnextPageIndex;//下一页序号 privatebooleanfirstPage;//是否为第一页 privatebooleanlastPage;//是否为最后一页 privateintperP;//每页显示页码数 privateintcurrentG;//当前组号 privateintallG;//共有组数 publicvoidsetRecordCount(intrecordCount){ this.recordCount=recordCount;//一共有多少个记录<core> if(recordCount%countPerpage==0){ pageCount=recordCount/countPerpage; }else{ pageCount=recordCount/countPerpage+1; } this.allG=(recordCount%(perP*countPerpage)==0)? (recordCount/(perP*countPerpage)) :(recordCount/(perP*countPerpage)+1);//获取一共有多少组 } @SuppressWarnings("unchecked") publicvoidsetCurrentPageIndex(intcurrentPageIndex){//设置当前页码<core> this.currentPageIndex=currentPageIndex; if(this.currentPageIndex>this.pageCount){ currentPageIndex=this.pageCount; this.currentPageIndex=currentPageIndex; } prePageIndex=currentPageIndex-1; nextPageIndex=currentPageIndex+1; if(currentPageIndex==1){ firstPage=true; }else{ firstPage=false; } if(currentPageIndex==pageCount){ lastPage=true; }else{ lastPage=false; } this.currentG=(currentPageIndex%perP==0)?(currentPageIndex/perP) :(currentPageIndex/perP+1);//当前是第几组 } //省略剩余的get(),set()函数 } MyHibernate3分页标签(2)—pageController2分页管理器 packagezjnu.soft.util; importjava.util.List; importjavax.servlet.http.HttpServletRequest; publicclasspageManage2{ privatepageController2pc; publicpageController2getPc(){ returnpc; } publicvoidsetPc(pageController2pc){ this.pc=pc; } @SuppressWarnings({"unchecked"}) publicvoidsetPageIndex(StringPageIndex,IntegerrecordCount,Listlist, HttpServletRequestrequest,IntegercountPerpage,IntegerperP){ if(list!=null&&list.size()!=0){ Stringstr=PageIndex; if(str==null)//初始化 { st