You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Guillaume Bilodeau <gb...@videotron.ca> on 2000/12/21 18:00:55 UTC

Location of application-specific configuration files

Hi,

I'm not sure if this is the right place to post this kind of message.  If
it's appropriate, then sorry for taking your time.

I have developed a Web application using the Java Servlet 2.2 API and
following a MVC architecture; I am testing using Tomcat 3.1. My servlets use
a singleton DatabaseManager to access an SQL database. This class'
constructor reads the JDBC driver and URL from a configuration file
(database.xml).

Where should I put this file? And what path should I use to access it?

Currently, the file is in \tomcat\bin and the FileInputStream uses the
"database.xml" path. I would like this file to be in the webapps\myapp
directory. Since the DatabaseManager isn't a servlet, it doesn't have access
to virtual-to-real path translation. Any ideas?


Thanks in advance!
Guillaume

~~~~~
Guillaume Bilodeau
gbilodeau@videotron.ca
http://pages.infinit.net/bilodg

"Only two things are infinite, the universe and human
 stupidity, and I'm not sure about the former."
     (Albert Einstein)