tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: tomcat & deploywar & context.xml
Date Mon, 21 May 2012 19:04:51 GMT
2012/5/21 Romain Manni-Bucau <rmannibucau@gmail.com>:
> Hi,
>
> how does tomcat manage context.xml at startup?
>
> from what i saw it uses org.apache.catalina.startup.HostConfig.DeployWar
> but in org.apache.catalina.startup.HostConfig#deployWAR it reads the
> context.xml file before overriding it with contextname info which ignores
> the context.xml file:
>
>            context.setName(cn.getName());
>            context.setPath(cn.getPath());
>            context.setWebappVersion(cn.getVersion());
>            context.setDocBase(cn.getBaseName() + ".war");
>
>
> did i miss sthg or is it a bug?
>

1. There are several context.xml files  (App's context.xml, Host's
"context.xml.default" file, common conf/context.xml). See Context in
config. reference for details.

2. App's context.xml is read twice, with different configuration of Digester.

When it is read by the second time, the name etc. are ignored.

That relates with the following documented feature: You cannot specify
path attribute on Context in app's own context.xml, because it is
already known a-priori from the name and location of the context file
itself.

The name and version are calculated from path.

The same with docBase.

Best regards,
Konstantin Kolinko

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


Mime
View raw message