使用 WTP 更改 eclipse 的内置 tomcat context.xml 文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6759219/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Change eclipse's built in tomcat context.xml file using WTP?
提问by Jacob
Is it possible somehow to modify the contents of the context.xml that eclipse uses when you are doing "Run as" -> "On server"... and "Debug as" -> "on server"
是否有可能以某种方式修改 eclipse 在执行“运行方式”->“在服务器上”...和“调试为”->“在服务器上”时使用的 context.xml 的内容
We have some settings that are in our production environments context.xml file and we need them to be available to eclipse built in tomcat as well.
我们在我们的生产环境 context.xml 文件中有一些设置,我们需要它们也可用于 eclipse 内置的 tomcat。
I know we could use eclipse to run run on an external server, but thats not as convenient.
我知道我们可以使用 eclipse 在外部服务器上运行,但这并不方便。
回答by Daniel
Have a look at the automatically created project "Servers". There should be a folder for each configured Server. There, open the context.xml and add anything you like to be in the "default" context (Parameter-Tags for example).
查看自动创建的项目“服务器”。每个配置的服务器都应该有一个文件夹。在那里,打开 context.xml 并在“默认”上下文中添加您喜欢的任何内容(例如参数标签)。
Anything that's inside there will be used to populate the context.xml WTP automatically creates on publishing for each project on that Server.
里面的任何东西都将用于填充 WTP 在发布时为该服务器上的每个项目自动创建的 context.xml。
Or use the project specific way: put a context.xml with your contents inside META-INF in your project (have a look here: http://wiki.eclipse.org/WTP_Tomcat_FAQ#How_do_I_specify_the_Tomcat_context_configuration_for_my_Web_Application.3F)
或者使用项目特定的方式:在你的项目的 META-INF 中放置一个带有你的内容的 context.xml(看看这里:http: //wiki.eclipse.org/WTP_Tomcat_FAQ#How_do_I_specify_the_Tomcat_context_configuration_for_my_Web_Application.3F)