我又遇上问题咯,求助,在线等待,4点以前
<%@ include file="opendb.jsp"%>
<%@ page contentType="text/html;charset=gb2312"%>
<%
java.lang.String strSQL; //SQL语句
String str_bg="#dfdfdf";
//if(Topic_type==null)
//{
//out.println("参数错误!");
//}
//else{
%>
<html>
<head>
<title>finder topic</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<STYLE type=text/css>A:link {
FONT-SIZE: 12px; COLOR: #0000ff; TEXT-DECORATION: none
}
A:visited {
FONT-SIZE: 12px; COLOR: #0000ff; TEXT-DECORATION: none
}
A:hover {
FONT-SIZE: 12px; COLOR: #ff9900; TEXT-DECORATION: underline
}
BODY {
FONT-SIZE: 12px; COLOR: #000000
}
TD {
FONT-SIZE: 12px; COLOR: #000000
}
</STYLE>
<body>
<TABLE cellSpacing=0 cellPadding=5 width=587 border=0 align="center">
<tr>
<td width="251" height='25' align=left bgcolor='#ffffff'>
<b> <font color='red'>主题 </font></b>
</td>
<td width="97" height='15' align=center bgcolor='#ffffff'>
<b><font color='red'>作者</font></b> </td>
<td width="76" height='15' align=center bgcolor='#ffffff'>
<b><font color='red'>回复</font></b> </td>
<td width="123" height='15' align=right bgcolor='#ffffff'><b><font color='red'>时间</font></b></tr>
<%int intPageSize; //一页显示的记录数
int intRowCount; //记录总数
int intPageCount; //总页数
int intPage; //待显示页码
java.lang.String strPage;
int i,j,k; //设置一页显示的记录数
intPageSize = 10; //取得待显示页码
strPage = request.getParameter("page");
if(strPage==null){
//表明在QueryString中没有page这一个参数,此时显示第一页数据
intPage = 1;
} else{
//将字符串转换成整型
intPage = java.lang.Integer.parseInt(strPage);
if(intPage<1) intPage = 1; }
strSQL = "select count(*) from forum_topic";
//获取记录总数
sqlRst = sqlStmt.executeQuery(strSQL);
//执行SQL语句并取得结果集
sqlRst.next(); //记录集刚打开的时候,指针位于第一条记录之前
intRowCount = sqlRst.getInt(1);
sqlRst.close(); //关闭结果集
intPageCount = (intRowCount+intPageSize-1) / intPageSize;
//调整待显示的页码
if(intPage>intPageCount) intPage = intPageCount;
//设置获取数据SQL语句
String Topic_type=request.getParameter("Topic_type");
sqlRst=sqlStmt.executeQuery("select * from forum_topic where Topic_type=\'"+Topic_type+"\'and Is_first=1 order by time desc");
//从数据库中查询出所有留言,按留言时间的倒序查询
//将记录指针定位到待显示页的第一条记录上
i = (intPage-1) * intPageSize;
for(j=0;j<i;j++) sqlRst.next();
//显示数据
i = 0;
while(sqlRst.next())
{
String Topic_name=sqlRst.getString("Topic_name");
String UName=sqlRst.getString("UName");
Timestamp Time=sqlRst.getTimestamp("Time");
Date date_time=new Date(Time.getTime());
Time time_time=new Time(Time.getTime());
int Total_reply=sqlRst.getInt("Total_reply");
//得到输出的参数
if(str_bg.equals("#dfdfdf")){
str_bg = "#ffffff";
}
else{
str_bg = "#dfdfdf";}%>
<tr bgcolor="<%=str_bg%>">
<td height='25' align=left>
<%out.println("<a href=\"view_topic.jsp?Topic_name="+Topic_name+"\">"+Topic_name+"</a>");%>
</td>
<td height='15' align=center> <%out.println(UName);%>
</td>
<td height='15' align=center><%out.println(Total_reply);%>
</td>
<td height='15' align=right><%out.println(""+date_time+" "+time_time+"");%></td>
</tr>
<% i++; } %><tr>
<td align=center colspan="4">
第<%=intPage%>页 共<%=intPageCount%>页
<%if(intPage<intPageCount){%>
<a href="finder.jsp?Topic_type=<%=Topic_type%>&page=<%=intPage+1%>">下一页</a><%
}
%>
<%if(intPage>1){%>
<a href="finder.jsp?Topic_type=<%=Topic_type%>&page=<%=intPage-1%>">上一页</a><%
//}
}
%>
</td></tr>
</table>
</body>
</html>
<%
//关闭结果集
sqlRst.close();
//关闭SQL语句对象
sqlStmt.close();
%>
分页出现问题,明明是一页的内容,但是它来了个第二页,是个空白页,请各位帮我看看,我看了好久也没弄明白是咋回事,谢谢