This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
How does a web container (like tomcat) handle .properties files for access by servlets?
For example, if a servlet needs to access some stored key-value pairs from a .properties file, where should this file be placed?
FileInputStream myPropertiesFile = new FileInputStream("myconfig"); Properties myProperties = new Properties(); myProperties.load(myPropertiesFile); // access properties from the object here... myPropertiesFile.close();
Where should this file be placed (for example, in case of tomcat) for the servlet to be able to read it?
Does the location change, if the class that needs to access the properties file is a web service? (Axis under tomcat)