From what I know, I should put the path of properties file in the Classpath. While I am developing a web application, I want to host multiple sites in one machine. So how can I use two different properties file? If I specify them in the Classpath, then the first one will be used according to order of the Classpath since both properties files have the same filename.

Alessandro A. Garbagnati

You can use getRealPath() for identifying the path of the web application, or, eventually, use the web application descriptor for passing properties or path to files.
This would make the applications more portable and specifications compliant.