Summary: | org.apache.catalina.startup.Constants specifies an absolute path for web.xml | ||
---|---|---|---|
Product: | Tomcat 8 | Reporter: | Alexander Veit <alexanderv> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 8.5.x-trunk | ||
Target Milestone: | ---- | ||
Hardware: | PC | ||
OS: | Linux |
Description
Alexander Veit
2018-03-12 08:12:39 UTC
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 |