将参数传递给tomcat实例的最佳方法是什么? [英] What's the best way to pass arguments to a tomcat instance?
问题描述
将参数传递给tomcat实例的最佳方法是什么?命令行参数是否可用于容器内的所有应用程序?我可以将参数传递给特定应用吗?我是否需要通过内置的应用服务器进行管理?
What's the best way to pass arguments to a tomcat instance? Are command line arguments available to all applications within the container? Can I pass arguments to particular apps? Do I need to manage this through the built in app server?
编辑:
为了澄清,我希望通过用于指定要使用的配置的参数。有时,这可能会指定一组配置文件,这些配置文件可能因环境而异。
To clarify, I'm looking to pass a parameter to specify the configs to use. Sometimes this might specify a set of configuration files which can differ per environment.
推荐答案
我认为配置它的最佳方法是使用server.xml和context.xml文件。这是添加JNDI配置的地方。您可以为每个应用程序使用不同的context.xml文件。在你的WAR文件中,将它放在META-INF目录下,Tomcat将导入它。
I believe that the best way to configure it would be to use the server.xml and context.xml files. This is the place to add JNDI configuration. You can have a different context.xml file for every application. In your WAR file place this at META-INF directory and Tomcat will import it.
这篇关于将参数传递给tomcat实例的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!