通过计数自己写程序分页。
http://expert.csdn.net/Expert/topic/1523/1523918.xml?temp=.9306757
http://expert.csdn.net/Expert/topic/1421/1421953.xml?temp=.8832514
应该有帮助
http://expert.csdn.net/Expert/topic/1523/1523918.xml?temp=.9306757
http://expert.csdn.net/Expert/topic/1421/1421953.xml?temp=.8832514
应该有帮助
解决方案 »
- 怎样在jsp中调用fckeditor?
- 使用POI处理word,大家了解POi的就都来看看,都有分哦
- lucene中的大小写问题
- javascripe 问题。大哥帮我解决一下!!!
- 请问高手!用JBulider做的WEB程序怎么在jcreator里运行!帮帮小弟我!我的JBulider!或者告诉我个网站下载JBulider9的网站谢谢了
- 初级菜鸟问hibernate高手一个娇弱的问题,谢谢各位大哥
- 请问:java中怎么把本地文件拷贝到远程服务器上?谢谢各位高手。请高手们能够给出思路或者是实例和源码。
- 如何在网页一打开就读取数据库中的信息
- 表单提交的问题。
- 这张图是用echarts做的吗??是用line3d吗?
- 如何解决分页,THANKS A LOT!
- 如何使用multipart/form-data将数据提交到另一个页面,并有返回值?
* 翻页处理
*/
private void locationPage(){
this.request = this.getRequest();
strStartRecord = request.getParameter("startRecord");
if(strStartRecord==null||strStartRecord.length()<=0){
strStartRecord = "0";
} strDisplayLength = request.getParameter("displayLength");
if(strDisplayLength==null||strDisplayLength.length()<=0){
strDisplayLength="10";
} if(!(strDisplayLength==null||strDisplayLength.length()<=0)){
lDisplayLength=Integer.parseInt(strDisplayLength);
}
else lDisplayLength =10; page_location = request.getParameter("page_location");
if(page_location==null||page_location.length()<=0){
page_location = "";
}
try{
if (Integer.parseInt(page_location)<=0)
page_location = "";
}
catch(NumberFormatException e){
page_location = "";
} if(!(page_location.length()==0)){
String rsCount = request.getParameter("count");
long lrsCount = Integer.parseInt(rsCount);
long temp = Integer.parseInt(page_location)*lDisplayLength;
if (lrsCount >= temp){
lStartRecord=(Integer.parseInt(page_location)-1)*lDisplayLength;
strStartRecord = String.valueOf(lStartRecord);
}
else {
if (lrsCount%lDisplayLength ==0)
lStartRecord = lrsCount/lDisplayLength*lDisplayLength - lDisplayLength;
else lStartRecord = lrsCount/lDisplayLength*lDisplayLength;
strStartRecord = String.valueOf(lStartRecord);
}
}
else if(!(strStartRecord==null||strStartRecord.length()<=0)){
lStartRecord=Integer.parseInt(strStartRecord);
}
} public int getCount(){
return this.count;
} public String getStrStartRecord(){
return this.strStartRecord;
} public String getStrDisplayLength(){
return this.strDisplayLength;
} public long getLStartRecord(){
return this.lStartRecord;
} public long getLDisplayLength(){
return this.lDisplayLength;
}locationPage()在做数据库查询前调用,在做rs结果集循环时:
while (rs.next()){
i++;
count++;
if((i>lStartRecord)&&(i<=(lStartRecord+lDisplayLength))){
。
。
。
}
}后面的方法在jsp里调用就可以做分页处理了!