下面这段程序哪里错了啊?
<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="java.io.*" %>
<HTML>
<BODY BGCOLOR=cyan><FONT Size=4>
<%!
int number=0;
File file=new File("count.txt");
synchronized void countPeople()//计算访问次数的同步方法
{
if(!file.exists())
{
number++;
try{
file.createNewFile();
FileOutputStream Out=new FileOutputStream("count.txt");
DataOutputStream dataOut=new DataOutputStream(out);
dataOut.writeInt(number);
out.close();
dataOut.close();
}
catch(IOException ee){}
}
else
{
try{
FileInputStream in=new FileInputstream("count.txt");
DataInputStream dataIn=new DataInputStream(in);
number=dataIn.readInt();
number++;
in.close();
dataIn.close();
FileOutputStream out=new FileOutputStream("count.txt");
DataOutputStream dataOut=new DataOutputStream(out);
dataOut.writeInt(number);
out.close();
dataOut.close();
}
}
catch(IOException ee){}
}
}
%>
<%
countPeople();
%>
<P><P>您是第
<%=number%>
个访问本站的客户。
</FONT>
</BODY>
</HTML>
错误提示是:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 5 in the jsp file: /Example2_3.jsp
Generated servlet error:
E:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\Example2_005f3_jsp.java:31: 'try' without 'catch' or 'finally'
try{
^
An error occurred at line: 5 in the jsp file: /Example2_3.jsp
Generated servlet error:
E:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\Example2_005f3_jsp.java:45: 'catch' without 'try'
catch(IOException ee){}
^
Generated servlet error:
E:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\Example2_005f3_jsp.java:49: 'class' or 'interface' expected
private static java.util.Vector _jspx_dependants;
^
Generated servlet error:
E:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\Example2_005f3_jsp.java:51: 'class' or 'interface' expected
public java.util.List getDependants() {
^
Generated servlet error:
E:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\Example2_005f3_jsp.java:111: 'class' or 'interface' expected
}
^
Generated servlet error:
E:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\Example2_005f3_jsp.java:112: 'class' or 'interface' expected
^
Generated servlet error:
E:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\Example2_005f3_jsp.java:8: org.apache.jsp.Example2_005f3_jsp should be declared abstract; it does not define getDependants() in org.apache.jsp.Example2_005f3_jsp
public final class Example2_005f3_jsp extends org.apache.jasper.runtime.HttpJspBase
^
An error occurred at line: 5 in the jsp file: /Example2_3.jsp
Generated servlet error:
E:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\Example2_005f3_jsp.java:22: cannot resolve symbol
symbol : variable out
location: class org.apache.jsp.Example2_005f3_jsp
DataOutputStream dataOut=new DataOutputStream(out);
^
An error occurred at line: 5 in the jsp file: /Example2_3.jsp
Generated servlet error:
E:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\Example2_005f3_jsp.java:24: cannot resolve symbol
symbol : variable out
location: class org.apache.jsp.Example2_005f3_jsp
out.close();
^
An error occurred at line: 5 in the jsp file: /Example2_3.jsp
Generated servlet error:
E:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\Example2_005f3_jsp.java:32: cannot resolve symbol
symbol : class FileInputstream
location: class org.apache.jsp.Example2_005f3_jsp
FileInputStream in=new FileInputstream("count.txt");
^
10 errors
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.