On Friday 17 November 2000 14:27, you wrote:
> Hi,
>
> I was wondering if it is possible to pass properties to Tomcat. I have
> some classes which read various system properties in their static
> initializers, and this works fine when using these classes on the command
> line using "java -Dproperty=value". However I am not sure how to pass
> these properties into tomcat when I start it. Is there something in one of
> the XML files?
yes, you can do it, by supplying it in TOMCAT_OPTS when invoking Tomcat.
However, it's ugly and results in non-portable web applications (you need to
set the properties on whatever servlet container is being used, and restart
it, and some may not allow you to set such things). It would be *better* to
put the properties you want into some config file specific to your web
application, in WEB-INF, to be loaded through ServletContext.getResource(),
or as servlet init parameters. Static initialisers? Ugh. Specify instead that
your servlets are to be initialised and get the data then. Self-containment
is the watchword for web applications.
--
Rachel