jsr369-experts@servlet-spec.java.net

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

From: Stuart Douglas <sdouglas_at_redhat.com>
Date: Tue, 1 Sep 2015 18:29:50 -0400 (EDT)

----- Original Message -----
> From: "Edward Burns" <edward.burns_at_oracle.com>
> To: jsr369-experts_at_servlet-spec.java.net
> Sent: Wednesday, 2 September, 2015 6:40:24 AM
> Subject: [jsr369-experts] Re: SERVLET_SPEC-137: Allow context root
>
> MT> On 01/09/2015 01:15, Shing Wai Chan wrote:
>
> SWC> If this is a Servlet 4.0 feature, there is most likely a Servlet
> SWC> TCK assertion for this. Mark, can you help us understand why you
> SWC> are taking such a strong position against it as a representative
> SWC> for the hugely important Tomcat community?
>
> >>>>> On Tue, 1 Sep 2015 19:19:45 +0100, Mark Thomas <markt_at_apache.org> said:
>
> MT> As I have said previously on this thread, web applications are meant
> MT> to be independent of the context path at which they are
> MT> deployed. Anything that encourages web application developers to
> MT> think that they can code to a specific context path is a bad idea.
>
> May I paraphrase the spirit of your position as "don't make it any
> easier than absolutely necessary to do bad things." While I agree with
> the spirit of your position, in this case I think that spirit is trumped
> by several factors, in decreasing order of importance.
>
> 1. many containers already offer this in a proprietary fashion
>
> 2. it sure would be convenient to offer it as a standard
>
> 3. we can put it at the bottom of a priority list, allowing the
> preservation of out-of-webapp context-root specification
>
> 4. we can name the XML element sufficiently obviously to make it clear
> the priority is below other ways of specifying the context-root.

I think that it is also important to note that for full Java EE servers it
is already possible to do this in application.xml.

I think that the 'someone may write some bad code' argument is not really
relevant. People will write bad code either way, I'm sure there are lots
of webapps out there that hard code the context path as the name of the
deployment.

>
> SWC> Yes, we should allow the container to override the context root
> SWC> configuration. We can discuss more on the XML element name once we
> SWC> agree to have this feature.
>
> MT> Then as I stated above, Tomcat will *always* override whatever is set
> MT> here - effectively ignoring it. I have no wish to deal with the
> MT> inevitable conflicts that will result when multiple applications all
> MT> want to be deployed with a context path of "".
>
> This is a good point. What do you do in Tomcat if multiple apps are
> attempted to be deployed with the same context root, even when it is ""?


You fail the deployment.

Stuart

>
> Ed
>
> --
> | edward.burns_at_oracle.com | office: +1 407 458 0017
> | 45 Business days til JavaOne 2015
> | 60 Business days til DOAG 2015
>