title: How to get property file in Tomcat
body: <p>I use Neatbeans to create a Java Class Library Project. This class (name: TestDB.java) is to do some DataBase jobs. I wrote a "config.properties" file to config some properties. The config.properties is located in the Project folder. In my class TestDB.java:</p>
  
  <pre><code>Properties properties = new Properties(System.getProperties());
  String configFile = "config.properties";
  properties.load(new FileInputStream(configFile));
  String param1 = properties.getProperty("Postgre.Driver1");
  </code></pre>
  
  <p>I can use a test case to get the property, That's OK.</p>
  
  <p>When I build this project and create a jar file. I want another web application to use this jar file to do some DB jobs. I already include the jar in my webapp and bulid a webproj.war. When I place this webproj.war to Tomcat and run the webapp. I can't get the property because I don't know which folder in the Tomcat webapp to place the config.properties. Anyone can help me to solve this question ?</p>