tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <>
Subject Re: context resources, replacement parameters
Date Fri, 08 Dec 2017 20:36:49 GMT
On 08/12/17 18:49, Chris Cheshire wrote:
> I have a directory resource set defined in my context.xml to handle images :
> <Resources>
>   <PreResources className="org.apache.catalina.webresources.DirResourceSet"
>                 base="${catalina.base}/cdn/p/images"
>                 webAppMount="/images" />
> </Resources>
> The /p in there actually represents the context path - a given sandbox
> might have the same webapp deployed at different context paths
> representing different development branches. Is it possible to use a
> replacement parameter similar to catalina.base to replace the context
> path the webapp is deployed at?

Yes. You can use ant style property replacement in any XML file that is
processed by the digester (server.xml, context.xml, web.xml)

See the opening section of

for details.


> I tried following the source through for DirResourceSet but couldn't
> see where even catalina.base is getting replaced.
> (I know ant is a solution and I eventually need it for other things
> too, but I have never used it and it's not a learning rabbit-hole I
> can go down right now)
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message