Am 2020-08-17 um 17:57 schrieb Jason Pyeron:
-----Original Message-----
From: Michael Osipov
Sent: Sunday, August 16, 2020 1:27 PM

Am 2020-08-16 um 18:16 schrieb Jason Pyeron:
Is there a better way than this?

Specifically - detect running Tomcat, then if under Tomcat (today only 
interested in v7 and v9)
obtain the version string as described [1] and shown on the Manager web 
application.

At least for the version, you can use my listener, it will expose all
all context-related information via JNDI. Give it a try:
http://mo-tomcat-ext.sourceforge.net/user-guide.html#ContextNamingInfoListener

Cute. I like how you use org.apache.catalina.LifecycleListener to have 
legitimate access to the org.apache.catalina.Context.

The only gotcha I have is it requires advanced knowledge that you are on 
Tomcat. Specifically, it requires Operations to configure the context.xml for 
the web application.

I see no portable way to solve this. In fact, from an app's POV. JNDI is portable through containers. If you want the version then you need to accept that this is Tomcat-specific information.

M

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to