JSP分页问题~谁能帮帮我啊? 在线等结果!!
小弟今天写了个JSP分页 但是第二页显示的还是和第一页一样的记录 谁能帮我看看怎么回事啊?
<HTML>
<HEAD>
<link href= "CSS/styles_content.css " rel= "stylesheet " type= "text/css "/>
</HEAD>
<body>
<form action= "/Offic/depe.do " method= "post ">
<table width= "95% " align= "center " cellpadding= "4 " cellspacing= "1 " bgcolor= "#859CAE " class= "page ">
<tr bgcolor= "#F5F7FA ">
<td height= "16 " align= "center " bgcolor= "#E6E9EF " class= "page "> <b> 部门名称 </b> </td>
<td height= "16 " align= "center " bgcolor= "#E6E9EF " class= "page "> <b> 上级部门 </b> </td>
<td height= "16 " align= "center " bgcolor= "#E6E9EF " class= "page "> <b> 部门电话 </b> </td>
<td height= "16 " align= "center " bgcolor= "#E6E9EF " class= "page "> <b> 部门备注 </b> </td>
</tr>
<%
int i = 0;
int ipage=5;//分页单位
int allpage;//总页数
int pages; //接受的页码变量
int cpage =1; //当前页
int spage; //开始页
int allCol=0;
Vector v = null;
int DEPID;
String DEPNAME;
int UPDEPID;
String DEPTEL;
String ADDITION;
String sql = "select COUNT(*) from DEPARTMENT_TABLE ";
ConnectionPooling cp = new ConnectionPooling();
cp.getStmt();
ResultSet pagers=cp.execQuery(sql);
while(pagers.next()){
allCol=pagers.getInt(1);
System.out.println(allCol);
}
//获得总页面数
allpage = (int)Math.ceil((allCol + ipage-1) / ipage);