John Keyes wrote:

> Hi,
>
> A set of our servers use the same properties file (Generic.properties).
> It has the JDBC connection stuff in it.  This works fine as we launch
> the servers passing the -Dconfig.home="" to when launching them.
>
> Now I have a JSP/Servlet set-up and I want it to use Generic.properties
> for this also.  The question is how do I access config.home ?
>
> I tried passing -Dconfig.home="" to the Java Web Server but this doesn't
> work and a non web server specific solution would be preferable.
>
> I think that this must be a common enough problem, is there a solution ?
>
> Thanks for your time,
>
> -John K
>

The approach I take for properties files is to use a PropertyResourceBundle to
load them.  This class finds the properties file in the class path, so you don't
have to worry about specifying where the file exists.  Examples of using this
class can be found in the Internationalization section of the JDK 1.1 or JDK 1.2
documentation bundle.  It is quite useful even if you do not need the
multi-language support that is also supported.

Craig McClanahan

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to