分页显示链接时报404错误
做了一个分页显示,在文本框中输入页码,提交可以转到指定页面,但点下一页,上一页的超级链接就会报404错误,求帮助,代码如下:
<body>
<%!
String odbcQuery;
int pageSize=3;
int pageCount=0;
%>
<%
String query_type=request.getParameter("select");
System.out.println(query_type);
if(query_type==null)query_type="学号";
System.out.println(query_type);
String query_content=request.getParameter("query");
System.out.println(query_content);
if(query_content==null)query_content="";
System.out.println(query_content);
if(query_type!=null&&query_content!=null)
{
query_type=new String(query_type.getBytes("ISO-8859-1"));
query_content=(new String(query_content.getBytes("ISO-8859-1"))).trim();
if(query_type.equals("学号"))
odbcQuery="Select* from glz where 学号 like'%"+query_content+"%'";
else if(query_type.equals("姓名"))
odbcQuery="Select* from glz where 姓名 like'%"+query_content+"%'";
else
odbcQuery="Select* from glz where 班级 like'%"+query_content+"%'";
}
else
odbcQuery="Select* from glz";
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}catch(
ClassNotFoundException e){}
try
{
Connection con=DriverManager.getConnection("jdbc:odbc:as");
Statement sql=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
ResultSet rs=sql.executeQuery(odbcQuery);
rs.last();
int lastRow=rs.getRow();
pageCount=(lastRow%pageSize==0)?(lastRow/pageSize):(lastRow/pageSize+1);
int showPage=1;
%>
<table align="center" bordercolor="#FF0000">
<form name="form1" method="get" action="fenye.jsp">
<tr bgcolor="#99CCCC">
<td>数据查询</td>
<td><select name="select">
<option value="学号" selected>学号</option>
<option value="姓名">姓名</option>
<option value="班级">班级</option>
</select></td>
<td>
<div align="center"><input name="query" type="text" id="query2" size="20">
</div></td>
<td>
<input name="tijiao" type="submit" value="查询">
<td> </td>
</tr>
</form>
<form name="form2" method="get" action="fenye.jsp">
<tr bgcolor="#CCCCCC">
<td bgcolor="#99CCCC">输入页码</td>
<td bgcolor="#99CCCC"><input name="showPage" type="text" id="showPage" size=4></td>
<input type="hidden" name="select" size=2 maxlength=10 class=sm