My properties file is placed just under root dir of my webapp.
properties.load(new FileInputStream("myfile.properties"));
gives:
java.io.FileNotFoundException: myfile.properties
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:97)
What is wrong here?
As a general rule of thumb:
System.out.println(System.getProperty("user.dir"));to your code.