What is context.xml?
context.xml is a Tomcat configuration file that is used to configure many per-webapp settings. Recent versions of JBoss allow you to place a context.xml file in the WEB-INF directory of your WAR. Because there is some overlap between jboss-web.xml and context.xml, there is some confusion over how and when context.xml should be used.
The general rule is that if you can do it in jboss-web.xml then the context.xml equivalent is ignored.
Why isn't context.xml usage better documented in JBoss docs?
Part of the problem is that context.xml has no DTD. There is no exhausive list of possible elements and overlaps with jboss-web.xml
The "path" attribute is the most commonly cited overlap jboss-web.xml. You should set the context-root in jboss-web.xml.
Why is context.xml needed at all? Couldn't all this be put into jboss-web.xml?
The reason we need context.xml is that there are some things that are used to configure Tomcat as oppossed to the JBoss wrapper around Tomcat. Some examples of ways you would use context.xml are found here:
Why is context.xml placed in META-INF whereas in jboss, it should be in WEB-INF?
Refer to the discussion in the following JIRA issue: http://jira.jboss.com/jira/browse/JBAS-2290