2012/5/21 Romain Manni-Bucau <rmannibu...@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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to