-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Brian,

Brian Barnett wrote:
> I have a struts-based application running on multiple tomcat
> instances, load balanced by a hardware load balancer, i.e., no Apache
> Web Server. I need a way at run-time to know which tomcat instance it
> is. Is there a way to access info in the server.xml or context.xml
> file at run-time? Can I specify some arbitrary value in either of
> those xml files that would be available at run-time?

Yes. Look into the <Environment> element within <GlobalNamingResources>.

http://tomcat.apache.org/tomcat-5.5-doc/config/globalresources.html

> Is there some other way to identify the tomcat instance at run-time?

Yes. You could set CATALINA_OPTS to include '-Dserver.id=whatever' in
your startup script. Then you can simply access this value using
System.getProperty("server.id").

> Is there a way to access CATALINA_HOME or CATALINA_BASE at run-time?

I don't think there's a reliable way to do this.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGzxBe9CaO5/Lv0PARAihCAJ4nvbj2r0F/PX/I6f6O8GMGl2QI/ACfctDM
/AB6MCyxh9QGQ+8oExgFjNA=
=vYWb
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to