tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Reger, Jr." <>
Subject How to get name of Engine a servlet is running in?
Date Fri, 02 Sep 2005 14:25:57 GMT
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.



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message