posted 14 years ago
You are correct. web.xml does not define the context root, and in fact, no J2EE-standard component does.
The Tomcat Context element defines the context root in its "path=" attribute. The Context Element can be defined in one of 3 places:
1. In a file in the WAR: META-INF/context.xml
2. In the Tomcat configuration: TOMCAT_HOME/conf/Catalina/localhost/xxxxxxx.xml (the "xxxxxxx" can be any valid filename)
3. In the Tomcat server.xml file (STRONGLY discouraged!)
If you deploy a WAR without a Tomcat Context definition, one is synthesized, but then you don't have control over the context root pathname.
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer