|
Java学习者论坛
错wu:
Exception reportmessage Internal Server Errordescription The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.exception java.lang.NumberFormatException:
at java.lang.Integer.parseInt(Integer.java:435)
at java.lang.Integer.parseInt(Integer.java:463)
at org.apache.jsp.supply_0005fquery$jsp._jspService(supply_0005fquery$jsp.java:121)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.Servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:484)
源代碼:
<%@ page language="java" contentType="text/HTML;charset=GB2312" %>
<%@ page import="java.sql.*" %>
<html>
<head>
<script language="javascript">
function doDel(){
if(document.theForm.hWhich.value==""){
alert("必须选择一個供应商!");
return false;
}else{
var ss="是否要刪除该供应商?";
if(confirm(ss)){
self.location.href="supply_del.jsp?sQuery=" + document.theForm.hWhich.value;
return true;
}else
return false;
}
}
function doEditSupply(){
if(document.theForm.hWhich.value==""){
alert("必须选擇一个公司!");
return false;
}
self.location.href="supply_edit.jsp?sQuery=" + document.theForm.hWhich.value;
return true;
}
</script>
<title>供应商查詢</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/mm.css" type="text/css">
</head>
<jsp:useBean id="cif" scope="session" class="test.wzsupply" />
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="theForm" method="post" action="">
<table width="100%" border="0" cellspacing="10" cellpadding="0">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="bborder">
<tr>
<td height="22">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="../p_w_picpath/loca.gif" width="16" height="16" hspace="3"
align="absmiddle">位置: <a href="../wzsupply/index.jsp">供应商管理</a>
> <a href="../wzsupply/supply_main.jsp" class="at">供应商信息</a> >
查看供应商信息</td>
<td align="right" width="30"><a href="#" onClick="self.history.back();"><img
src="../p_w_picpath/back2.gif" hspace="3" border="0" width="16" height="16"></a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellspacing="1" cellpadding="3" width="677" height="185">
<tr>
<td colspan="6" class="btd" width="669" height="16"></td>
</tr>
<tr class="btd3" align="center">
<td nowrap width="45" height="32"><span class="ct">選择</span></td>
<td width="135" height="32">供应商名称</td>
<td width="94" height="32"><span class="ct">供應商信用度</span></td>
<td width="84" height="32"><span class="ct">供应商电话</span></td>
<td width="119" height="32"><span class="ct">lian系人</span></td>
<td width="157" height="32"><span class="ct">地址</span></td>
</tr>
<%
ResultSet rcount=null;
ResultSet rs=null;
// ResultSet result=null;
String sql="";
int recordCount=0;
int pageSize=10;
int pageId=1;
int pageCount=0;
try{
sql=" select count(Id) as Id from Supply ";
rcount=cif.getQuery(sql);
}catch(Exception ex){
out.println(ex.getMessage());
}
if(rcount.next())
recordCount=rcount.getInt("Id");
rcount.close() ;
pageCount=(recordCount/pageSize);
if((recordCount%pageSize)!=0)
pageCount++;
boolean pageError=false;
// if(recordCount<1) {pageError=false;out.println("没有记錄可顯shi");}
if(recordCount>=1)
{
if(request.getParameter("pageId")==null||request.getParameter("pageId")=="")
pageId=1;
else pageId=Integer.parseInt(request.getParameter("pageId"));
if(pageId<1)
{
pageId=1;
pageError=true;
}
if(pageId>pageCount)
{
pageId=pageCount;
pageError=true;
}
if(pageId>=1)
{
sql=" select * from Supply order by Id";
rs=cif.getQuery(sql);
for(int j=0;j<(pageId-1)*pageSize;j++)
rs.next();
for(int i=0;i<pageSize;i++)
{
if(rs.next()){
// while(rs.next())
// {
// recordCount++;
%>
<tr class="btd2" >
<td align="center" width="45" height="36">
<%int Id=rs.getInt("Id");String SupplyId=String.valueOf(Id); %>
<input type="radio" name="radID" value="<%=Id%>" onClick="Javascript:doWhich();">
<%-- <% session.setAttribute("radID",Id);
%> --%>
</td>
<td width="135" height="36"><%=rs.getString("Supply_Name") %></a></td>
<td width="94" height="36"><%=rs.getString("Supply_Creditlevel")%></td>
<%String SupplyAddress=rs.getString("Supply_Address"); %>
<td width="84" height="36"><%=rs.getString("Supply_Phone")%></td>
<td width="119" height="36"><%=rs.getString("Supply_Chief")%></td>
<td width="157" height="36"><%=SupplyAddress%></td>
</tr>
<% }
}
}
// }catch(SQLException ex) {
// out.print( ex.getMessage());
// }
/* if(pageId>=1)
{
result=null;
sql=" select * from Supply order by Id";
result=cif.getQuery(sql);
for(int j=0;j<(pageId-1)*pageSize;j++)
result.next();
sql="select top "+pageSize +" * from Supply ";
sql+=" order by Id ";
result=cif.getQuery(sql);
}*/
} %>
<TR>
<td align="center" width="45" height="32">gong<STRONG><FONT color="red"><%=recordCount%></FONT></STRONG>条
</td>
<td width="135" height="32">共有<B><%=pageCount%></B>頁,顯示第<B><%=pageId %></B>页</td>
<td width="94" height="32">
<% rs.close();
if(pageId!=1){ %><a href="supply_query.jsp?pageId=1" target="_self">首页</a>|
<a href="supply_query.jsp?pageId=<%=pageId-1%>">shang页</a>|<%}else{%>首页|上页|<%}
if(pageId!=pageCount){%></td>
<td align="right" width="84" height="32">
<a href="supply_query.jsp?pageId=<%=pageId+1%>">下页</a>|<a
href="supply_query.jsp?pageId=<%=pageCount%>">尾頁</a>|<%}else{%>下页|尾页|<%}%> </td>
<TD width="119" height="32">转到<input type="text" name='pageId' size='6' >页 </TD>
<td width="157" height="32"> 第<%=pageId%>/<%=pageCount%>页</td>
</TR>
<tr>
<td colspan="6" class="btd" width="669" height="34">
<table border="0" cellspacing="0" cellpadding="5" width="100%">
<tr>
<td height="36" align="right">
<input type="submit" name="Submit222" value="删除"
onClick="javascript:return doDel();">
<input type="submit" name="Submit332" value="修改"
onClick="javascript:return doEditSupply();">
<input type="submit" name="Submit42" value="返回"
onClick="self.location.href='supply_main.jsp';">
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<script language="javascript">
//记录哪个设施bei选
function doWhich(){
var i=0;
//只有一个设施的情况下
<%if(recordCount==1) {%>
document.theForm.hWhich.value=document.theForm.radID.value;
<%}%>
//多个设施的qing况下
<%if(recordCount>1) {%>
while(true){
if(document.theForm.radID.checked){
document.theForm.hWhich.value="5";
if(document.theForm.hWhich.value=null||documetn.theForm.hWhich.value="")
document.theForm.hWhich.value="5";
break;
}
i++;
}
<%}%>
}
</script>
</body>
</html>
当我點修改,删除按钮时会报这个错误,我用的开发环境是jbuilder7,哪位大哥能帮帮我,zai线等,谢謝了!
欢迎来到Java学习者论坛,轉载請注ming地址:http://www.javaxxz.com. |
|