I'm using JSP with Java Web Server 2.0 Beta:
 
when the server side code is running (i.e. when you call a method of a bean) the
current working dir is the Web Server Home Dir (in my case is c:\JavaWebServer2.0\),
so, if you place yuor file Hello.txt in this dir, the exception will not arises.
If you are using another Web Server, you can discover wich is the working dir creating a file
(without specifing the path, but only del file name, e.g. "Hello_2.txt") from the bean code.
After the execution of the bean, you can find the file you created ("Hello_2.txt") in the
working dir of the bean.
 
bye, Paolo.
-----Original Message-----
From: Sachin S. Khanna <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: mercoledì 27 ottobre 1999 16.11
Subject: Amazing

Guys,
    When making a java application if i need to read a file say Hello.txt from a .java file known as Read.java i donot need to specify a path if both the files are in the same directory.
Well i'm facing an amazing problem when i try to do something similar using jsp.
I'm importing a .class file say Hi.class into my jsp page say Hello.jsp & i hava file named Hello.txt, the contents of which i read in the Hello.class file.
But as in the case of a java application i'm not specifying the path of the Hello.txt file in the Hello.class file because both of them are placed in the same directory instead i'm just calling it in the FileInputStream Constructor as "Hello.txt".
But i'm getting a FileNotFoundException.
Please explain to me why is it so & what way can i call the file Hello.txt from the Hello.class file.
Have a nice day.
With regards,
Sachin S. Khanna.

Reply via email to