throws IOException {}是什么东东呀?
qzfty 2003-06-09 09:03:17 qxdji.jsp页面:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<%@ include file="../session.jsp"%>
<html>
<head><title>缺陷登记
</title>
<link rel=stylesheet href="style.css" type="text/css">
<script language="JavaScript">
function newwin(url) {
var newwin=window.open(url,"newwin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=450");
newwin.focus();
return false;
}
</script>
</head>
<body>
<script LANGUAGE="javascript">
function submit11()
{
self.location.replace("qxdji.jsp")
}
</script>
<jsp:useBean id="bbsBean" scope="page" class="firm.firm" />
<%
int pageLine=10;
int totalRec=0;
int totalSub=0;
int intPage=1;
if (request.getParameter("page")!=null)
intPage=Integer.parseInt(request.getParameter("page"));
try{
ResultSet countrs=null;
//指定参考行数
//取得总数
countrs=bbsBean.executeQuery("select count(*) as cnt from board");
if (countrs.next())
totalRec=countrs.getInt("cnt");
countrs.close();
bbsBean.closeStmt();
//取得主题数
countrs=bbsBean.executeQuery("select count(*) as cnt from board");
if (countrs.next())
totalSub=countrs.getInt("cnt");
countrs.close();
bbsBean.closeStmt();
}
catch(Exception e){
e.printStackTrace();
}
//取得每行的主题数量
int jtemp=totalRec/pageLine+1;
int totalSubPerPage=totalSub/jtemp;
//取得总页数
int intPageCount=0;
intPageCount=(totalSub/totalSubPerPage * 10 + 5)/10 ;
%>
<center><font color="blue"><h4>设备缺陷登记管理</h4></font>
<%
out.print("<table border='1' cellspacing='0' width='632' bgcolor='#d7e3b9' bordercolorlight='#green' bordercolordark='#ECF5FF'>");
out.print("<tr align='center' bgcolor='#c8cc98'>");
out.print("<td width='240'>标题</td>");
out.print("<td width='60'>发表人</td>");
//out.print("<td width='100'>发表时间</td>");
out.print("<td width='40'>状态</td>");
out.print("<td width='40'>管理</td>");
out.print("</tr>");
%>
<%
String serial;
String title;
String recorder;
//Date providedate;
ResultSet RS=bbsBean.executeQuery("select * from board where parent_no=0 order by serial_no DESC");
int i=0;
while (RS.next()) {
i++;//-----------------显示本级的帖子内容
if (i>(totalSubPerPage *(intPage-1)) && (i<=(intPage * totalSubPerPage))){
out.print("<tr><td>");
serial=RS.getString("serial_no");
title=RS.getString("title");
recorder=RS.getString("recorder");
//providedate=RS.getDate("time");
// showing(request,out,serial,title,recorder,providedate,"Subject");
showing(request,out,serial,title,recorder,"Subject");
//-----------------显示下一级的回复内容
ResultSet RS1 = bbsBean.executeQuery("select * from board where parent_no=" + serial + " order by serial_no");
while (RS1.next()) {
out.print("<tr><td>");
serial=RS1.getString("serial_no");
title=RS1.getString("title");
recorder=RS1.getString("recorder");
// providedate=RS1.getDate("time");
//showing(request,out,serial,title,recorder,providedate,"Re");
showing(request,out,serial,title,recorder,"Re");
}
RS1.close();
bbsBean.closeStmt();
//------------------------
}
}
RS.close();
bbsBean.closeStmt();
%>
<!--以下函数用于帖子内容显示 -->
<%!
void showing(HttpServletRequest request,JspWriter out,String serial,String title,String recorder, String ReSign)
throws IOException {
if(ReSign=="Subject"){
out.print("<a href=bbsAnswer.jsp?serial=" + serial + " onClick=' return newwin(this.href);'>" + title + "</a>");
}
else{
out.print("<a href=bbsReply.jsp?serial=" + serial + " onClick=' return newwin(this.href);'>" + title + "</a>");
}
out.print("</td><td align='center'>");
out.print(recorder);
out.print("</td></tr>");
}
%>
<!--以下用于帖子分页显示 -->
<%
out.print("<tr>");
out.print("<a href='qxdj.jsp '>缺陷登记</a> ");
if (intPage < 1 )
intPage=1;
out.print("<form method='POST' name=fPageNum action='qxdji.jsp'>");
out.print("<p align='left'>>>分页 ");
if (intPage<2)
out.print("<font color='999966'>首页 上一页</font> ");
else{
out.print("<a href='qxdji.jsp?page=1'>首页</a> ");
out.print("<a href='qxdji.jsp?page=" + (intPage-1) + "'>上一页</a> " );
}
if( intPage-intPageCount>=0 )
out.print("<font color='999966'>下一页 尾页</font>" );
else{
out.print("<a href='qzdji.jsp?page=" + (intPage+1)+ "'>下一页</a> <a href='qxdji.jsp?page=" + intPageCount + "'>尾页</a>");
}
out.print(" 页次:<strong><font color=red>"+intPage+"</font>/"+intPageCount+"</strong>页 " );
out.print(" 共<b>"+totalRec+"</b>条记录 <b>"+pageLine+"</b>条/页 " );
out.print(" 转到第<input type='text' name='page' size=2 maxlength=10 class=smallInput value="+intPage+">");
out.print("页<input class=buttonface type='submit' value='GO' name='cndok'></span></p></form>" );
out.print("</td>");
out.print("</tr>");
out.print("</table>");
out.print("</center>");
%>
</p>
</body>
</html>
---------------------------报错信息----------------------------------
Note: sun.tools.javac.Main has been deprecated.
D:\resin-2.1.6\doc\program\new\quexian\qxdji.jsp:107: Class _program._new._quexian.IOException
not found in throws.
throws IOException {
^
D:\resin-2.1.6\doc\program\new\quexian\qxdji.jsp:109: Exception java.io.IOException
must be caught, or it must be declared in the throws clause of this method.
out.print("<a href=bbsAnswer.jsp?serial=" + serial + " onClick=' return newwin(this.href);'>" + title + "</a>");
^
D:\resin-2.1.6\doc\program\new\quexian\qxdji.jsp:133: Class _program._new._quexian.IOException
not found in try.
try {
^
3 errors, 1 warning
-------------------------------------------------------------------------
请高手指点。谢谢。。。。