vbkraemer wrote (see http://forums.java.net/jive/thread.jspa?messageID=269540
for complete background):
The context-root of a web app deployed inside an ear is determined by:
1. the value of the context-root element in the ear file's
2. the value of context-root element in the ear file's application.xml
3. the default value computed by using the module's web-uri...
Adding a forth method of determining the context-root, that requires
introspection of a second level of archived content, may have seemed
like overkill to the implementors.
Honoring the context-root specified in a web module's sun-web.xml regardless of
whether the web module is deployed on its own, or as part of an EAR, would be a
good idea. This would allow for the web module to simply be "dropped" into an
EAR (and have its context-root take effect), without having to edit any
sun-application.xml or application.xml.