如何在 Eclipse Web 项目中将 WebContent 文件夹更改为不同的内容?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1581683/
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
How do I change in an eclipse web project the WebContent folder to something different?
提问by Mauli
With the Galileo release it is finally possible to convert a normal Java project to a dynamic web project. Unfortunately it assumes that the Web stuff is located in a folder WebContent, which is not necessarily the case for an existing project. How can I change it? In MyEclipse it is quite easy, but with a stock eclipse I don't find such an option!
随着 Galileo 版本的发布,终于可以将普通的 Java 项目转换为动态的 Web 项目。不幸的是,它假定 Web 内容位于文件夹 WebContent 中,而现有项目不一定如此。我怎样才能改变它?在 MyEclipse 中,这很容易,但是对于库存日食,我找不到这样的选择!
回答by Thierry
I am not sure what you meant by "a stock eclipse", but Helios allows this functionality in a very straight-forward way:
我不确定您所说的“股票日食”是什么意思,但 Helios 以非常直接的方式允许此功能:
回答by Peter ?tibrany
I am not sure if there is UI for this or not, but you can edit file .settings/org.eclipse.wst.common.component, and change following line:
我不确定是否有用于此的 UI,但您可以编辑文件 .settings/org.eclipse.wst.common.component,并更改以下行:
<wb-resource deploy-path="/" source-path="/WebContent"/>
Change /WebContent
to your preferred directory. I use this for a several years now and encountered no problems with it.
切换/WebContent
到您的首选目录。我用了好几年了,没有遇到任何问题。
回答by John John Pichler
Go in the project properties and do like this example where I use the Maven webapp folder:
进入项目属性并像这个示例一样使用 Maven webapp 文件夹: