The custom way would be to write a startup listener that its only goal
is to load a prop file and promote its properties into the System
environment.
It could look somethng like this:
package cowbell;
import org.apache.catalina.Lifecycle;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;
public class PropListener implements LifecycleListener {
public void lifecycleEvent(LifecycleEvent event) {
if (Lifecycle.INIT_EVENT.equals(event.getType())) {
try {
System.getProperties().load("fixMe");
} catch(Throwable evil){
}
}
}
}
And in server.xml like this:
<Listener className="cowbell.PropListener " />
-Tim
Mike Reidy wrote:
Hello,
I would like to be able to configure system properties at Tomcat start-up
*without* adding them to the startup command line, for example you might add
-Dxx.yyy.zzz=123 to the command line to add a system property called
xxx.yyy.zzz with a value of 123. I want something other than this....
I was hoping that there might be a way of loading an additional properties
file in a similar way to catalina.properties but I cannot see this in
documentation. Does this exist? If so can someone point me at the
documentation please.
If this is not the case is there a standard way that would be the
recommended way of writing a custom plugin for Tomcat to do this?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org