Get application context root through JNDI
Is there a way to get the context-root of the currently running application at runtime? The name of the application is no problem:
String appName = (String)InitialContext.doLookup("java:app/AppName")
Likewise, I tried:
String appContextRoot = (String)InitialContext.doLookup("java:app/ContextRoot")
but no dice. When I look at the application details in the admin panel, I see a number of "properties":
I would expect that all these properties can be queried, but so far I only succeeded in getting the Name of the application. Is it possible to get to the others as well?
I need to retrieve the context-root from a static method, so I cannot use HttpRequest.