JSP文件读取问题
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.io.*" %>
<html>
<head>
读取文件数据
</head>
<body>
<%
try{
String path=getServletContext().getRealPath("dt.txt");
FileReader input=new FileReader(path+File.separator+"dt.txt");
int in=input.read();
while(in!=-1){
out.print((char)in);
in=input.read();
if(in==13){
out.print("<br>");
input.skip(1);
in=input.read();
}
}
input.close();
}catch(FileNotFoundException fnfe){
out.print(fnfe);
}catch(IOException ioe){
out.println(ioe);
}
%>
</body>
</html>
读取文件数据 java.io.FileNotFoundException: C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\file\dt.txt (系统找不到指定的文件。)
请问JSP开发时文件应该要放在什么目录下才会被读取?