JSP中读文件的间题!
jsp文件和count.txt文件放在同一个目录下,出错说系统指不到count.txt
我的jsp文件内容如下:
<%@ page import="java.io.*,java.util.*" contentType="text/html;charset=gb2312" %>
<html>
<head>
<title>Hello</title>
</head>
<body>
<%
String file = "count.txt";
BufferedReader in = new BufferedReader(new FileReader(file));
String strCount = in.readLine();
int count = Integer.parseInt(strCount);
count++;
%>
当前计数:<%= count %>
</body>
</html>