数据库是sqlserver2000,有几个表,我要通过jsp页面对这些表实现一些增、删、改功能,可是每次重启tomcat后就只能正常显示第一个页面的功能,后面别的表的jsp页面都会报错,这个不针对哪个表,只是第一个操作的正常。这个问题第一次遇见,而且很头疼,还请各路高手帮助出谋划策,不胜感激!!jsp主页面代码:(其他的页面也类似)
<%@ page contentType="text/html; charset=gb2312" language="java" errorPage="" %>
<%@ page import="com.eteda.xj.dao.*" %>
<%@ page import="com.eteda.xj.model.*" %>
<%@page import="java.util.*"%>
<jsp:useBean id="page_sep" class="com.eteda.xj.dao.DAOjshyshy" scope="session"/><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>港口驾驶员审验信息</title>
</head><body>
<p><a href="jshyshy_add.jsp">添加</a></p><%
int intPageSize=10;
int currPageBegin;
int intPageCount;
int intPage;
String strPage;
strPage = request.getParameter("pagenumber");
if(strPage==null)
{
intPage = 1;
}
else
{
intPage = Integer.parseInt(strPage);
if(intPage<1)
intPage = 1;
}
Vector vector=new Vector();
vector=page_sep.queryAll();
intPageCount = (vector.size()+intPageSize-1) / intPageSize;
if(intPage>intPageCount)
intPage = intPageCount; currPageBegin = intPage*intPageSize-intPageSize;
int i=0;
Vector all = null ;
all = (Vector)request.getAttribute("all") ;
%>
<table width="100%" border="1">
<tr>
<th width="26" scope="col">序号</th>
<th width="100" scope="col">审验单位</th>
<th width="100" scope="col">审验时间</th>
<th width="100" scope="col">审验数量</th>
<th width="100" scope="col">审验人员</th>
<th width="100" scope="col">审验项目</th>
<th width="100" scope="col">审验情况</th>
<th width="100" scope="col">备注</th>
<th width="30" scope="col"> </th>
<th width="30" scope="col"> </th>
</tr>
<%
jshyshy js=new jshyshy();
if(vector.size()!=0){
for(int j=currPageBegin;j<intPage*intPageSize&&j<vector.size();j++)
{
js=(jshyshy)vector.elementAt(j);
i++ ;
%>
<tr>
<th scope="row" align="center"><%=js.getid() %></th>
<td align="center"><%=js.getshydw() %></td>
<td align="center"><%=js.getshyshj() %></td>
<td align="center"><%=js.getshyshl() %></td>
<td align="center"><%=js.getshyry() %></td>
<td align="center"><%=js.getshyxm() %></td>
<td align="center"><%=js.getshyqk() %></td>
<%
System.out.println("res:"+js.getres());
if(js.getres()!=null){ %>
<td align="center"><%=js.getres() %></td>
<%}else{ %>
<td>--</td>
<%} %>
<td align="center"><a href="jshyshy_mod.jsp?&id=<%=js.getid() %>">修改</a></td>
<td align="center"><a href="../jshyshyServlet?action=3&id=<%=js.getid() %>" onclick='return confirm("您确定要删除吗?")'>删除</a></td>
</tr>
<%} }%>
</table><script language="javaScript">
function openPage(curpage)
{
document.spage.pagenumber.value = curpage ;
// alert(cupage) ;
document.spage.submit() ;
}
function selOpenPage()
{
document.spage.pagenumber.value = document.spage.selpage.value ;
document.spage.submit() ;
}
</script><form name="spage" action="jshyshy.jsp">
<table align=center>
<tr><td align=center> 每页共<%=intPageSize %>行 第<%=intPage%>页 共<%=intPageCount%>页
<br/>
<%
if(intPage==1) {
out.print(" 首页 ");
}else {
%>
<a href="jshyshy.jsp?pagenumber=1">首页</a>
<%
}
%>
<% if(intPage>1){ %>
<a href="jshyshy.jsp?pagenumber=<%=intPage-1%>">上一页</a>
<% }else{ %>
上一页
<%}%>
<% if(intPage<intPageCount){ %>
<a href="jshyshy.jsp?pagenumber=<%=intPage+1%>">下一页</a>
<% }else{ %>
下一页
<%}%>
<%
if(intPage==intPageCount) {
out.print(" 尾页 ");
}else {
%>
<a href="jshyshy.jsp?pagenumber=<%=intPageCount%>">尾页</a>
<%
}
%>
<input type="hidden" name="pagenumber" value=""/>
跳转到<select name="selpage" onChange="selOpenPage()">
<%
for(int x=1;x<=intPageCount;x++)
{
%>
<option value="<%=x%>" <%=intPage==x?"selected":""%>><%=x%></option>
<%
}
%>
</select>页
</td>
</tr>
<% if(i==0)
{
// 进行提示
%>
<tr>
<td colspan="5">没有任何内容!!!</td>
</tr>
<%
}
%>
</table>
</form>
</body>
</html>
报错描述:
java.lang.ClassCastException
<%@ page contentType="text/html; charset=gb2312" language="java" errorPage="" %>
<%@ page import="com.eteda.xj.dao.*" %>
<%@ page import="com.eteda.xj.model.*" %>
<%@page import="java.util.*"%>
<jsp:useBean id="page_sep" class="com.eteda.xj.dao.DAOjshyshy" scope="session"/><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>港口驾驶员审验信息</title>
</head><body>
<p><a href="jshyshy_add.jsp">添加</a></p><%
int intPageSize=10;
int currPageBegin;
int intPageCount;
int intPage;
String strPage;
strPage = request.getParameter("pagenumber");
if(strPage==null)
{
intPage = 1;
}
else
{
intPage = Integer.parseInt(strPage);
if(intPage<1)
intPage = 1;
}
Vector vector=new Vector();
vector=page_sep.queryAll();
intPageCount = (vector.size()+intPageSize-1) / intPageSize;
if(intPage>intPageCount)
intPage = intPageCount; currPageBegin = intPage*intPageSize-intPageSize;
int i=0;
Vector all = null ;
all = (Vector)request.getAttribute("all") ;
%>
<table width="100%" border="1">
<tr>
<th width="26" scope="col">序号</th>
<th width="100" scope="col">审验单位</th>
<th width="100" scope="col">审验时间</th>
<th width="100" scope="col">审验数量</th>
<th width="100" scope="col">审验人员</th>
<th width="100" scope="col">审验项目</th>
<th width="100" scope="col">审验情况</th>
<th width="100" scope="col">备注</th>
<th width="30" scope="col"> </th>
<th width="30" scope="col"> </th>
</tr>
<%
jshyshy js=new jshyshy();
if(vector.size()!=0){
for(int j=currPageBegin;j<intPage*intPageSize&&j<vector.size();j++)
{
js=(jshyshy)vector.elementAt(j);
i++ ;
%>
<tr>
<th scope="row" align="center"><%=js.getid() %></th>
<td align="center"><%=js.getshydw() %></td>
<td align="center"><%=js.getshyshj() %></td>
<td align="center"><%=js.getshyshl() %></td>
<td align="center"><%=js.getshyry() %></td>
<td align="center"><%=js.getshyxm() %></td>
<td align="center"><%=js.getshyqk() %></td>
<%
System.out.println("res:"+js.getres());
if(js.getres()!=null){ %>
<td align="center"><%=js.getres() %></td>
<%}else{ %>
<td>--</td>
<%} %>
<td align="center"><a href="jshyshy_mod.jsp?&id=<%=js.getid() %>">修改</a></td>
<td align="center"><a href="../jshyshyServlet?action=3&id=<%=js.getid() %>" onclick='return confirm("您确定要删除吗?")'>删除</a></td>
</tr>
<%} }%>
</table><script language="javaScript">
function openPage(curpage)
{
document.spage.pagenumber.value = curpage ;
// alert(cupage) ;
document.spage.submit() ;
}
function selOpenPage()
{
document.spage.pagenumber.value = document.spage.selpage.value ;
document.spage.submit() ;
}
</script><form name="spage" action="jshyshy.jsp">
<table align=center>
<tr><td align=center> 每页共<%=intPageSize %>行 第<%=intPage%>页 共<%=intPageCount%>页
<br/>
<%
if(intPage==1) {
out.print(" 首页 ");
}else {
%>
<a href="jshyshy.jsp?pagenumber=1">首页</a>
<%
}
%>
<% if(intPage>1){ %>
<a href="jshyshy.jsp?pagenumber=<%=intPage-1%>">上一页</a>
<% }else{ %>
上一页
<%}%>
<% if(intPage<intPageCount){ %>
<a href="jshyshy.jsp?pagenumber=<%=intPage+1%>">下一页</a>
<% }else{ %>
下一页
<%}%>
<%
if(intPage==intPageCount) {
out.print(" 尾页 ");
}else {
%>
<a href="jshyshy.jsp?pagenumber=<%=intPageCount%>">尾页</a>
<%
}
%>
<input type="hidden" name="pagenumber" value=""/>
跳转到<select name="selpage" onChange="selOpenPage()">
<%
for(int x=1;x<=intPageCount;x++)
{
%>
<option value="<%=x%>" <%=intPage==x?"selected":""%>><%=x%></option>
<%
}
%>
</select>页
</td>
</tr>
<% if(i==0)
{
// 进行提示
%>
<tr>
<td colspan="5">没有任何内容!!!</td>
</tr>
<%
}
%>
</table>
</form>
</body>
</html>
报错描述:
java.lang.ClassCastException
你提交到其他页的时候 带的参数有问题吧
自己好好看看