<%
try {
Properties properties = new Properties( );
properties.load( new FileInputStream( new File( "library.properties" )
) );
out.println( properties );
} catch( java.io.FileNotFoundException fnf ) { out.println( fnf ); }
%>
The code written above is a piece of code from my jsp file. I want to load
library.properties file into the properties object.
But I get java.io.FileNotFoundException.
I am deploying my application on BEA Weblogic 7.0 using jdk1.3.1_06. I am
keeping this file in the same directory, where my jsp files are lying.
But I am getting this exception. (I have also tried by keeping the file in
the directory where weblogic is keeping the complied servlet. but it is
still not working. Although I don't any such kind of solution. I have also
tried by all relative paths. I don't want to hardcode the full path of the
file.) I have tried to load a properties file in a simple Test class, there
it works.
import java.io.*;
public class Test {
public static void main( String ar[] ){
File file = new File( "A.txt" );
System.out.println( file );
}
}
It works in the above code. here A.txt at the same place, where Test class
is.
please give me some solution.
http:\www.hcltechnologies.com