Also, is Head.txt spelled correctly and in an
accessible directory reachable with localhost
in your webserver?

Todd

-----Original Message-----
From: [Mina Gohari] [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 16, 2000 3:00 AM
To: [EMAIL PROTECTED]
Subject: Read a TXT file


     Hi to all professional

     I use from Apache and NT as server , I wrote a servlet that this
     servlet read from a txt file , It said that FileNotFoundException ,
     Why? please answer me.

     Thanks in advance.


     try {
           File inputFile = new File("http://localhost:8000/Head.txt");
           in = new FileReader(inputFile);
           while ((c = in.read()) != -1)
             HTMLBuffer.append((char) c);
           in.close();
         }
     catch (IOException ioe) {
           HTMLBuffer.append(ioe.toString());
         }

     Mina

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to