tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raghupathy,Gurumoorthy" <>
Subject RE: How to get name of Engine a servlet is running in?
Date Fri, 02 Sep 2005 14:34:14 GMT
What yo uare doing is a very tomcat specifi thingy ... Use JNDI variable to
do things ...


-----Original Message-----
From: Joe Reger, Jr. [] 
Sent: 02 September 2005 15:26
Subject: How to get name of Engine a servlet is running in?

I'm trying to gain access to the name of the Engine that a servlet is 
running in. In most cases this will be "Catalina" as configured in the 
/conf/server.xml file. But when another Engine is configured, say 
"CatalinaTesting", I need to get that name instead.

I've tried to navigate the methods and classes from:

but I haven't been able to find the Engine name in any of the attributes or 

Is there any way to get it? 

Actually, all I really need is a small string that's unique to each Engine 
configured on the server and stays the same after application 
deployments/restarts. What I'm currently using is code that grabs the last 
two directories in the root app path and concatenates them... something like

"webappsROOT" or "webappsTestingROOT". It's unique, but ugly.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message