开发者

Parametrized value of Apache Tomcat Context Attributes or Context variables?

开发者 https://www.devze.com 2023-03-19 02:37 出处:网络
I have java开发者_Go百科 webapp under Tomcat with such sample context: <Context path=\"reports\" docBase=\"E:\\generatedReports\"></Context>

I have java开发者_Go百科 webapp under Tomcat with such sample context:

<Context path="reports" docBase="E:\generatedReports"></Context>

On unix attribute docBase different:

<Context path="reports" docBase="/usr/generatedReports"></Context>

Can I have ONE context.xml (for crossplatform and keeping simple build scripts)? Value of docBase attribute must be parameter managed in other place?


Technically Yes, you can keep one file and parametrize it when building.

The problem with doing this via build scripts is that context.xml sits outside the webapps and is part of the conf, i.e. the Tomcat installation directory.

You ideally want minimum interference with files in the conf folder and so rather than having it as part of the build and released artifacts, I would suggest you version control it as context.xml.windows and context.xml.unix or something similar.

And yourself or your admin should manually change/edit these files ensuring all changes are justified.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号