MyHibernate分页标签使用文档.doc
上传人:yy****24 上传时间:2024-09-10 格式:DOC 页数:10 大小:60KB 金币:16 举报 版权申诉
预览加载中,请您耐心等待几秒...

MyHibernate分页标签使用文档.doc

MyHibernate分页标签使用文档.doc

预览

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

16 金币

下载此文档

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

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