一个奇怪的jsp初级问题
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Counter Version 1.0</title>
</head>
<body background="#ffffff">
<%@page import="java.io.*"%>
<%
BufferedReader file;
String countFile="C:\jakarta-tomcat-5.0.19\webapps\myproject\count.txt";
file = new BufferedReader(new FileReader(countFile));
String readStr = null;
int writeStr=1;
try
{readStr = file.readLine();
}
catch(IOException e)
{
System.out.println("error when try to read data!!!");
}
if (readStr == null)
readStr = "no record!!!";
else
{
writeStr = Integer.parseInt(readStr)+1;
}
try
{ PrintWriter pw;
pw = new PrintWriter(new FileOutputStream(countFile));
pw.println(writeStr);
pw.close();
}
catch(IOException e)
{
out.println(e.getMessage());
}
%>
<p align="center">
<H1>visitors' counter:</H1>
<H3>you are the
<font size="7" color="#804000">
<%=readStr%>
</font>that visit this website!!! </h3>
</body>
</html>
就是一个简单的程序计数器,我把那个count.txt放在和这个文件相同的目录下,但是她说找不到,
然后又改称绝对路径,他说:
C:\jakarta-tomcat-5.0.19\work\Catalina\localhost\myproject\org\apache\jsp\Text_jsp.java:56: illegal escape character
String countFile="C:\jakarta-tomcat-5.0.19\webapps\myproject\count.txt";
^
郁闷,真是为了什么,高手知道一下,谢谢
!!!