Howdy,
We actually hold the configuration in a bean-like class.  We have a
configurator utility class that exposes a couple of configure methods:
one that takes a ServletContext, another an InitialContext, another a
filesystem path to config directory.  So we can (and do, in production)
use the same app from the command-line, in an J2EE container, in a
servlet-only container, etc.

You could do it all using classpath-based resource location, and avoid
having to write a configurator like the above.  But I'm really nitpicky
about project source / deployment organization, and I can physical
twitches when I see configuration files on the classpath.  OK, maybe I'm
not that picky, but I still dislike it ;)

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Larry Meadors [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, May 28, 2003 10:23 AM
>To: [EMAIL PROTECTED]
>Subject: RE: placement of properties files
>
>I did that for a while but changed when teting them became difficult.
>
>By putting them in the classpath, you can test without any
>monkey-business (tech. term) to get the ServletContext, and the class
>that gets the config is also not coupled to servlets, so I can use it
>for a swing app, or command line utility.
>
>Larry
>
>>>> [EMAIL PROTECTED] 05/28/03 7:10 AM >>>
>I don't like to put configuration information on the classpath however.
>I prefer to access them via other mechanisms, such as the
>ServletContext.  So I would create a directory called config under
>WEB-INF, put the file (say a.props) there, and access it via
>InputStream is =
>ServletContext.getResourceAsStream("/WEB-INF/config/a.props");
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to