如何使用-D系统属性为doc运行tomcat

时间:2012-03-09 13:03:01

标签: tomcat ant tomcat6

在tomcat配置中,我们有一个像这样的docBase:

<Context path="/" docBase="webapps/rootExample"/>

是否可以在运行时从某些外部属性文件或作为-D系统属性在tomcat启动时提供docBase属性?

1 个答案:

答案 0 :(得分:0)

系统属性对整个JVM是全局的,所以答案是否定的。

您可以做的是在<context-param>中提供类似内容的web.xml

另一种选择是使用JNDI,其中每个webapp都有某种检查配置设置的机制。