On 18/02/2016 11:00, Romain Manni-Bucau wrote:
> On a personal side i tend to agree and like to have filesystem aligned with
> the deployment
> but I have to admit I saw path usage in META-INF/context.xml being quite
> large (in real deployments or in tooling integration).
> 
> I understand your example but it is true at each level including
> conflicting names in conf/* or server.xml.

No it isn't.

You can't have conflicting names in conf and/or appBase.

server.xml always takes priority so no conflict either.

> Now 90% of the usages are to strip the version from the war name (most
> build tools generate mywar-1.2.3[.QUALIFIER].
> Maybe a flag to strip it on tomcat side would solve most of the cases and
> don't encourage that much the risk you refer to?
> 
> Something like:
> 
> <Context stripVersion="true" />
> 
> Wdyt?

No need. The version marker can be used for that:

mywar##1.2.3[.QUALIFIER].war

Mark


> 
> 
> 
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com>
> 
> 2016-02-18 11:56 GMT+01:00 Mark Thomas <ma...@apache.org>:
> 
>> On 18/02/2016 10:42, Romain Manni-Bucau wrote:
>>> Hi guys,
>>>
>>> <Context path="/override" /> in <war>/META-INF/context.xml was used a lot
>>> for tomcat 6/7 and doesn't work anymore since tomcat 8 (didn't check if
>> it
>>> has been backported, can be).
>>>
>>> It is documented but I don't get why this feature has been removed.
>>> typically checking if path is null or not before setting ContextName
>> would
>>> be enough to  keep the feature working.
>>>
>>> Do I miss anything?
>>
>> Yes. Consider the following:
>>
>> test1.war with META-INF/context.xml containing <Context path="/test2" />
>> test2.war with no context.xml
>>
>> Put them both in the appBase of a default, running Tomcat instance. What
>> happens?
>>
>> If you want to change the path, either:
>> - change the name of the WAR
>> or
>> - locate it outside the appBase and put a context.xml file in
>> conf/<engine>/<host>
>>
>> The only place path is used is if the Context is defined in server.xml
>> and defining contexts in server.xml is strongly discouraged.
>>
>> Mark
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: dev-h...@tomcat.apache.org
>>
>>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to