运行后报错啊:
type Status reportmessage count.txt (系统找不到指定的文件。)description The requested resource (count.txt (系统找不到指定的文件。)) is not available.--------------------------------------------------------------------------------

解决方案 »

  1.   

    File f1=new File("count.txt");
          f1.createNewFile();生成一个
      

  2.   

    我用的tomcat服务器,我把count.txt放在了tomcat的没一层目录,都不行啊。
    还是报错。
      

  3.   

    File f1=new File("count.txt");
          if(!f1.exists())f1.createNewFile();
    红猩猩都说了
      

  4.   

    你自己比较一下:
    <html>
    <body>
    <%@ page import="java.io.*"%>
    <%  
      BufferedReader file;
      String countFile="c:\\count.txt";
     
      String readStr=null;
      int writeStr=1;
      try
         {
             file=new BufferedReader(new FileReader(countFile));
            readStr=file.readLine();
            }catch(IOException e)
             {
                System.out.println("read data error");
             }
    if(readStr==null) readStr="no data";
    else
       {
        writeStr=Integer.parseInt(readStr)+1;
       }try{
           PrintWriter pw;
            pw=new PrintWriter(new FileOutputStream(countFile));
            pw.println(writeStr);
            pw.close();
    } catch(IOException e)
     {
       System.out.println(e.getMessage());
     }
       %>
    <h1> you are the </h1>
    <h3> <%=readStr%></h3>
    <h1> vistor to the page</h1>
    </body>
    </html>
      

  5.   

    若是tomcat5就在tomcat目录下比如:d:\tomcat5.0\count.txt若是weblogic8.1那么就要试试一下,我没有试过,哈