jsp 分页有关问题 点击上一页的时候 参数传进去了 但是点击的时候无法分页jsp 分页有关问题 点击上一页的时候 参数传进去了 但是点击的时候无法分页
jsp 分页问题 点击下一页的时候 参数传进去了 但是点击的时候无法分页
%@ page contentType= text/html;charset=GBK language= java import= java.sql.*,java.util.*
errorPage= %
html
%@ include file= top.jsp %
link href= css.css rel= stylesheet type= text/css ...
jsp 分页有关问题 点击上一页的时候 参数传进去了 但是点击的时候无法分页
jsp 分页问题 点击下一页的时候 参数传进去了 但是点击的时候无法分页
%@ page contentType= text/html;charset=GBK language= java import= java.sql.*,java.util.*
errorPage= %
html
%@ include file= top.jsp %
link href= css.css rel= stylesheet type= text/css
div align= center
center
table width= 778 border= 0 cellspacing= 0 cellpadding= 0 style=
border-collapse: collapse bordercolor= #111111
tr
td width= 0% height= 25 bgcolor= #DBC2B0 align= center
font color= #FFFFFF b 新闻热点 /b /font /td
/tr
%
String mypage;
int intpage=1;
mypage=request.getParameter( page );
if(mypage== )
intpage=1;
if(!mdb.IsInt(mypage))
intpage=1;
if(mdb.IsInt(mypage))
intpage=Integer.parseInt(mypage);
if(intpage 1)
intpage=1;
mypage=Integer.toString(intpage);
int curIndex=1;
int PageSize =10; //设置每张网页显示10条记录
int ShowPage = 1; //设置欲显示的页数
int RowCount = 0; //ResultSet的记录数目
int PageCount = 0; //ResultSet分页后的总页数
int duoyu=0;
RowCount=mdb.getCount( Select count(*) as count from news order by news_ID DESC );
System.out.println(RowCount);
duoyu=RowCount % PageSize;
System.out.println(duoyu+ llllllllllllll );
System.out.println(RowCount+ ddddddddd );
System.out.println(PageSize+ eeeeeeeeee );
if(duoyu==0)
{
PageCount=RowCount/PageSize;
}
else{
PageCount=(RowCount-duoyu)/PageSize;
PageCount++;
}
ShowPage=intpage;
if(ShowPage PageCount)
{
ShowPage=PageCount;
}
else if(ShowPage =0)
{
ShowPage = 1;
}
curIndex=(ShowPage - 1)*PageSize;
if(curIndex==0){
curIndex=-1;
}
//计算欲显示页的第一笔记录位置
%
!----------------------one showing unit-------------------------------
%
//利用For循环配合PageSize属性输出一页中的记录
int i=1,news_id,linshi=1;
linshi=ShowPage;
String news_title;
Collection coll=mdb.getCollection( Select * from news order by news_ID
DESC ,new String[]{ news_id , news_title , news_date },curIndex);
本文档为【jsp 分页有关问题 点击上一页的时候 参数传进去了 但是点击的时候无法分页】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。