Eclipse中的Tomcat覆盖上下文片段 [英] Tomcat inside Eclipse overwrites context fragments

查看:103
本文介绍了Eclipse中的Tomcat覆盖上下文片段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用WST连接到Tomcat 6的Eclipse项目。出于测试原因,我需要设置一些上下文参数来覆盖web.xml中的设置。设置以下服务器选项:无需发布,因为我想从项目中直接运行我的应用程序,并将上下文发布到单独的XML文件。



现在我可以在.metadata.plugins\org.eclipse.wst.server.core\tmp1\Conf\catalina\localhost中找到上下文片段,并根据需要进行更改。这可以工作一段时间,但是每次Eclipse重新启动之后,我的上下文片段都被一个新生成的片段替换,当然没有必要的参数。



如何防止Eclipse替换我的配置?还是有一种方法可以为生成的上下文片段添加必要的参数?

解决方案

当然会更改.metadata /中的内容。 ../wst.server不是一个好主意 - 这些目录完全由Eclipse控制。



如果您查看Eclipse的服务器项目条目,您将看到server.xml和context.xml - 这是更改内容的地方。 Eclipse将这些文件复制到该.metadata目录 - 如果它没有被弄脏。


I have an Eclipse Project which is attached to a Tomcat 6 using WST. For testing reasons I need to set some context parameters to override settings in the web.xml. The following Server Options are set: "Serve without publishing" as I want to run my application right from the project and "Publish contexts to separate XML files".

Now I can find the context fragment inside .metadata.plugins\org.eclipse.wst.server.core\tmp1\Conf\catalina\localhost and change them as needed. This works for some time, but after each Eclipse restart my context fragment is replaced with a fresh generated one - without the required parameters of course.

How can I prevent Eclipse from replacing my configuration? Or is there a way to add the necessary parameters to the generated context fragment?

解决方案

Certainly changing stuff in the .metadata/.../wst.server is not a good idea - those directories are completely controlled by Eclipse.

If you look in your Eclipse 'Servers' project entry, you will see server.xml and context.xml - that is the place to change things. Eclipse copies those files to that .metadata directory - IF it isn't fouled up somehow.

这篇关于Eclipse中的Tomcat覆盖上下文片段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆