catch(IOException ee)()改成catch(IOException ee) {}

解决方案 »

  1.   

    <html>
    <body bgcolor=cyan><font size=1>
        <%! int number=0;
        synchronized void countPeople() //计算访问次数的同步方法
    {
    if(number==0)
    {
    try
    {
    FileInputStream in = new FileInputStream("count.txt");
    DataInputStream dataIn = new DataInputStream(in);
    number = dataIn.readInt();
    number++;
    in.close();
    dataIn.close();
    }
    catch(FileNotFoundException e)
    {
    number++;
    try
    {
    FileOutputStream out = new FileOutputStream("count.txt");
    DataOutputStream dataOut = new DataOutputStream(out);
    dataOut.writeInt(number);
    out.close();
    dataOut.close();
    }
    catch(IOException e){}//就这里粗心,也不
                                                                         // 要同个参数
    }
    catch(IOException ee){}
    }
    }
    %>
    <%
    countPeople();
    %>
    <p><p>您是第
        <%=number%>
    个访问本站的客户
    </font>
    </body>
    </html>
      

  2.   

    <body bgcolor=cyan><font size=1>
        <%! int number=0;%>  必须用<% %>括起来!因为你有<%! 
        <% synchronized void countPeople() //计算访问次数的同步方法
    {
      

  3.   

    500错误是不是在xml中配错了呀?