org.apache.jasper.JasperException: An exception occurred processing JSP page /JavaSmp/smp164.jsp at line 5//错误提示
2: <html><head><title>读出文件</title></head><body><center><b><font size=4 color=red>读文件</font><br><hr><br><%
3: String r1;
4: String pah=request.getRealPath("./");
5: FileReader fr=new FileReader(new File(pah+"\\smp164.txt"));
6: BufferedReader br=new BufferedReader(fr);
7: while((r1=br.readLine())!=null)
8: out.println(r1+"<br>");%></b></center></body></html>
java.io.FileNotFoundException: C:\apache-tomcat-6.0.20\apache-tomcat-6.0.20\webapps\ROOT\.\smp164.txt (系统找不到指定的文件。)
以上是错误提示
我不是将smp164.txt 放在和smp164.jsp 一样的文件夹(/JavaSmp/smp164.jsp,都在ROOT根目录)吗?郁闷
顺便问一下语句5中 new File(pah+"\\smp164.txt");把路径表示对了吗?