I have a servlet deployed as a war in JBoss 4.0.2. I have a properties file for the deployed application. Where should I put this file? Under the conf directory in the jbo
The best place to put it is under the web-apps' own doc-root, like "./WEB-INF/myapp.properties", i.e. relative to where the servlet container unpacked your .war or .ear file. You can provide the properties file directly in the .war.
The ServletContext has a method getRealPath(String path) that returns the actual path in the filesystem. Using the real path you can load it in a Properties collection.
Update The code in your comment tries to lookup real path for "/", you should ask for the relative path to your properties file, as in:
String propertiesFilePath = getServletContext().getRealPath("WEB-INF/application.properties");
Properties props = properties.load(new FileInputStream(propertiesFilePath));