You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Chew Kok Hoor <ko...@gmail.com> on 2022/10/01 15:20:50 UTC

Context Name replacement variable for conf/context.xml

Hi all,

    I would like to configure $CATALINA_BASE/conf/context.xml to set up
a Manager but would like to add the context name as one of the parameters
to the manager (keyPrefix).

    Is there a variable or a list of variables I can use for this purpose?
As using environment or java defined variables will not fit this use case.

Thanks.

Regards,
    Kok Hoor

Re: Context Name replacement variable for conf/context.xml

Posted by Mark Thomas <ma...@apache.org>.
Chris,

I think you misunderstood the requirement.

My reading of the OP request is that they want to add a standard 
<Manager .../> element to conf/context.xml so each web application uses 
the same custom session manager implementation. They want to be able to 
configure that session manager with at least one attribute that depends 
on the context name/path so that they can maintain separation of session 
manager instances between web applications.

We have something like this for JULI: ${classloader.webappName}.

There isn't anything that can currently do this for conf/context.xml but 
it might be possible to leverage WebappProperties that JULI uses to 
implement a new PropertySource. I haven't looked. I suggest created an 
enhancement request for this feature in Bugzilla.

Mark


On 03/10/2022 03:14, Christopher Schultz wrote:
> 
> Kok Hoor,
> 
> On 10/1/22 10:20, Chew Kok Hoor wrote:
>> I would like to configure $CATALINA_BASE/conf/context.xml to set up
>> a Manager
> 
> Don't do this.
> 
>> but would like to add the context name as one of the parameters to the 
>> manager (keyPrefix).
> 
> It's much easier to copy webapps/manager/META-INF/context.xml to 
> CATALINA_BASE/conf/Catalina/localhost/keyPrefix-manager.xml and allow it 
> so auto-deploy to that context-path.
> 
>> Is there a variable or a list of variables I can use for this purpose? 
>> As using environment or java defined variables will not fit
>> this use case.
> If you can't use system properties or environment variables, then what 
> options do you actually have?
> 
> -chris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

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


Re: Context Name replacement variable for conf/context.xml

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Kok Hoor,

On 10/1/22 10:20, Chew Kok Hoor wrote:
> I would like to configure $CATALINA_BASE/conf/context.xml to set up
> a Manager

Don't do this.

> but would like to add the context name as one of the 
> parameters to the manager (keyPrefix).

It's much easier to copy webapps/manager/META-INF/context.xml to 
CATALINA_BASE/conf/Catalina/localhost/keyPrefix-manager.xml and allow it 
so auto-deploy to that context-path.

> Is there a variable or a list of variables I can use for this 
> purpose? As using environment or java defined variables will not fit
> this use case.
If you can't use system properties or environment variables, then what 
options do you actually have?

-chris

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