帮忙看下这个程序!!!怎么总报错。。我是照着书写的啊。。菜鸟急。。
take5 2003-01-24 11:21:34 <html>
<head>
<title>jishuqi</title>
</head>
<body>
<%@ page import="java.io.*" %>
<%
//out.println(request.getHeader("Cookie"));
String currentRecord==null;
BufferedReader file;
String nameOfTextFile="count.txt";
file=new BufferedReader(new FileReader(NameOfTextFile));
String readStr =null;
int writeStr=0;
try
{
readstr=file.readLine();
catch (IOException e)
{
System.out.println("it is worry");
}
if (readStr==null)
readStr="NO message";
else if (request.gethearder("Cookie")==null)
{
writeStr=Integer.parseInt(readStr)+1;
}
else
{
writeStr=Integer.parseInt(readStr);
}
if (request.getheader("Cookie")==null)
{
try
PrintWriter pw =( new PrintWriter(new FileoutputStream(nameOfTextFile));
pw.println(writeStr);
pw.close;
}
catch(IOException e)
{
out.println(e.getmessage());
}
}
%>
<p align="center">you are num<b>
<font color="red"><%=writeStr%></font></b>people.</p>
</body>
</html>
下面是resin的报错信息
Note: sun.tools.javac.Main has been deprecated.
/jishu.jsp:19: 'catch' without 'try'.
catch (IOException e)
^
/jishu.jsp:35: '{' expected.
try
^
/jishu.jsp:36: ')' expected.
PrintWriter pw =( new PrintWriter(new FileoutputStream(nameOfTextFile));
^
/jishu.jsp:40: 'catch' without 'try'.
catch(IOException e)
^
/jishu.jsp:46: 'try' without 'catch' or 'finally'.
pageContext.write(_jsp_string2, 0, _jsp_string2.length);
^
5 errors, 1 warning