tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raghupathy,Gurumoorthy" <gurumoorthy.raghupa...@uk.fid-intl.com>
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 ...

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-resources-howto.html

Regards
Guru

-----Original Message-----
From: Joe Reger, Jr. [mailto:regerj@gmail.com] 
Sent: 02 September 2005 15:26
To: tomcat-user@jakarta.apache.org
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:
request.getSession().getServletContext()
request.getSession()

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

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.

Thanks,

Joe

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message