jeudi 5 mars 2015

What is the relative path for application.properies file below?



enter image description here


application.properties need to be loaded in LoadProperties.java file.


public static Properties loadProperties() {



Properties props = new Properties();
try{
FileInputStream fis = new FileInputStream("application.properties");
props.load(fis);
fis.close();
}catch(IOException ioe){
ioe.printStackTrace();
}
return props;
}


The above code works fine in normal Java Project but when I add this in Dynamic Web project path not recognized because folder structure is differ


I tried in many ways and got java.io.FileNotFoundException: application.properties (The system cannot find the file specified) error


Any help would be appreciated!




Aucun commentaire:

Enregistrer un commentaire