分页显示问题!!

xuefeifangpei 2003-04-08 01:27:56
我的代码如下但是为什么报错:org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
..\work\localhost\tousu\_0002fsearch_0002ejspsearch_jsp_61.java:303: 'try' without 'catch' or 'finally'.
out.write("\r\n \r\n \r\n ??");
^
..\work\localhost\tousu\_0002fsearch_0002ejspsearch_jsp_61.java:378: Type expected.
} catch (Throwable t) {
^
2 errors, 1 warning


<%@ include file="head.jsp"%>
<%@ page contentType="text/html;charset=8859_1" %>
<%@ page language="java" import="java.sql.*" %>
<jsp:useBean id="workM" scope="page" class="Show.DBconn" />
<html>
<head>
<LINK href="mycss.css" rel=stylesheet type=text/css>
<title>Untitled</title>

</head>


<%
int i,intpage,intpagecount,intpagerowcount,intpagesize;//变量的含义分别为:记录总数、当前页的第一条记录号、当前页的最后一条记录号、前一页页码、后一页页码、最后一页页码、当前页码(or 所要求的页码);
String pagestr,strSQL;
pagestr=request.getParameter("page");
if(pagestr==null)
{ intpage=1;
}
else
{
intpage=Integer.parseInt(request.getParameter("pagestr"));
if(intpage<1) intpage=1;
}
String keyword,way,keyword1;
keyword=request.getParameter("keyword");
keyword1=request.getParameter("keyword1");
way=request.getParameter("way");
if (way==null)
way="";
strSQL="";
//////////////投诉类别********************
if(way.trim().equals("1")){
strSQL="SELECT tousu_class,tousu_date,depart,handle,person FROM data where";
strSQL=strSQL+" tousu_class = '"+keyword+"' order by id ";

}

//////////////投宿部门********************
if(way.trim().equals("2")){
strSQL="SELECT ousu_class,tousu_date,depart,handle,person into aa FROM data where";
strSQL=strSQL+" depart like '%"+keyword+"%' order by id ";
}

//////////////投宿时间********************
if(way.trim().equals("3")){
strSQL="SELECT ousu_class,tousu_date,depart,handle,person FROM data where ";
strSQL=strSQL+" tousu_date between #"+keyword+"# and #"+keyword1+"# order by id" ;


}
//////////////处理情况********************
if(way.trim().equals("4")){
strSQL="SELECT ousu_class,tousu_date,depart,handle,person FROM data where";
strSQL=strSQL+" handle like '%"+keyword+"%' order by id";
}
//////////////处理人********************
if(way.trim().equals("5")){
strSQL="SELECT ousu_class,tousu_date,depart,handle,person FROM data where";
strSQL=strSQL+" person = '"+keyword+"' order by id";
}
//////////////投宿情况描述********************
if(way.trim().equals("6")){
strSQL="SELECT ousu_class,tousu_date,depart,handle,person FROM data where";
strSQL=strSQL+" details like '%"+keyword+"%' order by id";
}
//out.println("strSQL");
ResultSet RSa = workM.executeQuery(strSQL);
//获取总记录数
RSa.last();
introwcount=RSa.getRow();
//计算总页数
intpagecount=(introwcount+intpagesize-1)/intpagesize;
//调整待显示的页码
if(intpage>intpagecount) intpage = intpagecount;
%>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="5%" height="20" bgcolor="#3399ff"><font color="Red">ID</font></td>
<td width="5%" height="20" bgcolor="#3399ff"><font color="Red">投诉类别</font></td>
<td width="15%" height="20" bgcolor="#3399ff"> <font color="Red">投诉时间</font></td>
<td width="15%" height="20" bgcolor="#3399ff"><font color="Red">投诉部门</font></td>
<td width="10%" height="20" bgcolor="#3399ff"> <font color="Red">处理情况</font></td>
<td width="10%" height="20" bgcolor="#3399ff"> <font color="Red">处理人</font></td>
<td width="10%" height="20" bgcolor="#3399ff"> <font color="Red">详情</font></td>
</tr>
<%
if (intpagecount>0)
//将记录指针移到待显示页码的第一条上
RSa.absolute((intpage-1) * intpagesize + 1);
//显示数据
i = 0;
while(i<intpagesize && !RSa.isAfterLast()){
%>
<tr>
<td><%=RSa.getString(1)%></td>
<td><%=RSa.getString(2)%></td>
<td><%=RSa.getString(3)%></td>
<td><%=RSa.getString(4)%></td>
<td><%=RSa.getString(5)%></td>
<td><%=RSa.getString(6)%></td>
<td><a href=data.jsp?id="+id+">详情</a></td>
</tr>
<%
RSa.next();
i++;
}
}
%>
</table>

第<%=intpage%>页  共<%=intpagecount%>页  
<%if(intpage<intpagecount){%><a href="search.jsp?page=<%=intpage+1%>">下一页</a>
<%}%>  <%if(intpage>1){%><a href="search.jsp?page=<%=intpage-1%>">上一页</a><%}%>
<%RSa.close()%>

<%@ include file="footer.inc"%>
</html>
...全文
30 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
zuoyangguang 2003-04-08
  • 打赏
  • 举报
回复
gz

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧