The value of org.apache.catalina.startup.Constants.ApplicationWebXml is "/WEB-INF/web.xml". This is an absolute path. Consequently at least the Java NIO API resolves it to the absolute path /WEB-INF/web.xml. The same holds for the WarTracker constant. All other constants in the class are specify relative paths: ApplicationContextXml = "META-INF/context.xml" ApplicationWebXml = "/WEB-INF/web.xml" DefaultContextXml = "conf/context.xml" DefaultWebXml = "conf/web.xml" HostContextXml = "context.xml.default" HostWebXml = "web.xml.default" WarTracker = "/META-INF/war-tracker"
Can you clarify what is wrong and where ? These constants are not all used in the same context, and some need to be absolute path, others not. For starters, ApplicationWebXml="/WEB-INF/web.xml" is correct.
In our code which embeds Tomcat, I've used Path dirDocBase; .. = dirDocBase.resolve(Constants.ApplicationWebXml); It resolves to /WEB-INF/web.xml which is an absolute path, starting at the root of the file system. But maybe the constant class is intended for internal use only. Then I would be fine with not using this class.
That constants class has evolved over time based on how the constants were used. The constants are correct and - in any case - can't easily be changed without breaking the potential usage of them by others. I did notice a couple of usages of the constants are aren't quite right. Those we should clean up. I don't like the inconsistency between ApplicationContextXml and ApplicationWebXml but I'm not sure it is worth fixing at this point.
Sounds like a documentation bug, if anything.
Comments improved and a couple of incorrect usages fixed. Fixed in: - trunk for 9.0.7 onwards - 8.5.x for 8.5.30 onwards - 8.0.x for 8.0.51 onwards - 7.0.x for 7.0.86 onwards