Parametrized value of Apache Tomcat Context Attributes or Context variables?
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.
精彩评论