users@servlet-spec.java.net

[servlet-spec users] [jsr369-experts] Re: Re: Re: SERVLET_SPEC-137: Allow context root

From: Shing Wai Chan <shing.wai.chan_at_oracle.com>
Date: Wed, 02 Sep 2015 12:30:42 -0700

EB> Some very important questions remain.

EB> 1. What precisely must be said in the specification about conflicts?

EB> Is it possible to skirt any ordering related issues? Is it safe to
EB> take a "first one wins" approach?

I plan to add an optional element with string type in web-app_4_0.xsd schema
(not the web-fragment schema) for specifying a default context-root.
The default context-root can be overridden by the application.xml in an
Java EE application or
container specific configurations.
If the resulting context-root of the web application has been used by
another application in the
Servlet container, then the deployment of the web application should be
failed.

EB> 2. What precisely is the XML element name?

EB> I favor a long and descriptive name conveying this is a default of
EB> last resort.

Let me summarize the vendor specific xml element for this as follows:
<context-root>/foo</context-root>:
WebLogic (weblogic.xml), GlassFish (glassfish-web.xml), Geronimo
(geronimo-web.xml), JBoss (jboss-web.xml)

<context-root uri=“/foo”/>: Liberty (ibm-web-ext.xml)

<context-path>/foo</context-path>: JEUS

<Set name=“contextPath”>/foo</Set>: Jetty

So, I propose the following options for the xml element
a) <context-root>
b) <default-context-root>

The former is more concise.
The latter is a bit longer but more explicit about the `default’.

Any comments?
Shing Wai Chan