开发者

In eclipse, is there a way to specify a location other than the WEB-INF, for web.xml

I want to place development web.xml in 开发者_高级运维another folder in eclipse.


This can be done using the Deployment Assembly properties. Right click on the web project, choose Properties, and then navigate to the Deployment Assembly panel. Remove the /WebContent entry (pointing to /) and then add another entry, of type Folder. It should be rooted where you want to keep the web.xml, and mapped to /.

This technique can be extended to make Eclipse work with arbitrary build tool source layouts.


You might want to use Apache Ant for that purpose. You may define a "conf" directory and place all you config files there, or a resource directory for the same reason.

If haven't use ant for that purpose, I strongly recommend you to do so.

Here is a sample ant build.xml for a web app Sample Build.XML

I'll use Maven myself, but since you're just beginning, Ant would be just fine.


I am using the eclipse builder and not ant. Actually what i did was that i defined web.xml in another folder. So now I have two web.xml, one for welogic with a lot weblogic specific stuff like filters. And i have another for development which i placed in another folder, in the web project and added this folder to the deployment descriptor for tomcat in eclipse. So now when i deploy the application, the web.xml for tomcat which is in my specified folder owerwrites the web.xml present in web-INF folder(in the deployment directory). Looks to me a nice workaround.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜