David Kerber wrote:
This is a followup to my question about startup parameters. After
digging around a bit, it looks like my best bet is to use the
Properties class to read my settings from a disk file at startup. The
properties api appears to be easy to use, and works very similarly to
the Preferences class. My question is how to locate the file without
hard-coding its location. I have looked at several possibilities, and
can't work out the details on any of them even after a bunch of
googling. :-(
1. Pass the location of the file as a JVM -D argument at app
startup. But I can't figure how how to pick that value up inside my app.
Figured this one out, once I finally hit on the right search terms.
It's System.getProperty( "my.property.name", "DefaultValue"), where the
JVM argument is -Dmy.property.name=MyPropertyValue.
2. Put the config file somewhere in the tree of my webapp, such at
docbase or in conf. But again, I can't figure out how to pick that
location in a form I can use to read the file in with a FileReader
object.
I'd still like to figure this one out, though.
3. ???
Any suggestions greatly appreciated!
Dave
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]