将context.xml与Eclipse WTP放在何处? [英] Where to put context.xml with Eclipse WTP?
问题描述
我正在使用Eclipse Indigo 3.7 + WTP + m2e(包括m2e-wtp)。我在Eclipse上配置了我的Tomcat 7.0服务器。我有一个Web应用程序,我试图通过Eclipse在Tomcat上运行,但是当我运行它时,context.xml文件不会被复制到conf / Catalina / localhost目录,这会导致我的应用程序出现一些问题。
I'm using Eclipse Indigo 3.7 + WTP + m2e (including m2e-wtp). I've configured my Tomcat 7.0 server on Eclipse. I have a web application that I'm trying to run on Tomcat through Eclipse, but when I run it, the context.xml file is not copied to the conf/Catalina/localhost directory and this causes some issues to my app.
应该放置context.xml以便复制到这个目录?
Where the context.xml should be put in order to be copied to this directory?
谢谢
推荐答案
如果在将WAR文件部署到Tomcat时需要指定context.xml文件,则必须将其包含在WAR中。实现此目的的最简单方法是将其添加到您的webapp资源:
If you need to specify a context.xml file when deploying a WAR file to Tomcat, then it must be included within the WAR. The simplest way to achieve this is by adding it to your webapp resources:
src
|_ main
|_ webapp
|_ META-INF
|_ context.xml
当您构建Web应用程序(* .war)时,maven会在适当的位置将其加入WAR。
When You will build your web app (*.war) maven will join it to WAR in suitable place.
这篇关于将context.xml与Eclipse WTP放在何处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!