Bug 64189 - Expose Context Version as Servlet Context attribute
Summary: Expose Context Version as Servlet Context attribute
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 9.0.x
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2020-03-02 16:09 UTC by Nicola Isotta
Modified: 2020-03-03 08:54 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Nicola Isotta 2020-03-02 16:09:03 UTC
In environments where parallel deployment is heavily used, having easy access to the Context Version would be really useful for logging/debugging purposes.
Maybe a ServletContext attribute with the name "webappVersion" or "org.apache.tomcat.contextVersion" or something like that.
Right now I have to use a (ugly) workaround found in this stackoverflow question: https://stackoverflow.com/questions/8230310/tomcat-7-retrieve-the-version-of-a-webapp-versioned-war
Comment 1 Michael Osipov 2020-03-02 19:07:51 UTC
This is a duplicate of BZ 59232. I plan to add all context information as in here: http://mo-tomcat-ext.sourceforge.net/apidocs/net/sf/michaelo/tomcat/extras/listeners/ContextNamingInfoListener.html
Comment 2 Mark Thomas 2020-03-02 20:02:45 UTC
Sort of. JNDI isn't always enabled so there is a use case for this stand-alone feature as well.

Fixed in:
- master for 10.0.0-M2 onwards
- 9.0.x for 9.0.32 onwards
- 8.5.x for 8.5.52 onwards
- 7.0.x for 7.0.101 onwards
Comment 3 Nicola Isotta 2020-03-03 08:54:28 UTC
Many thanks.