Java webcontent和webapp的区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18412866/
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
Difference webcontent and webapp
提问by user1883212
I've two Spring MVC projects in Eclipse, but the web content is in different positions.
我在 Eclipse 中有两个 Spring MVC 项目,但是 web 内容在不同的位置。
In one app it's located under:
在一个应用程序中,它位于:
/WebContent
In the other app under:
在另一个应用程序中:
/src/main/webapp
Why that? What's the difference?
为什么?有什么不同?
Is there any way I can see how each project was created in order to create a new one in the same fashion?
有什么方法可以让我看到每个项目是如何创建的,以便以相同的方式创建一个新项目?
回答by Sanjeev
Project directory structure depends on how it was created and the build tool which you are using.
项目目录结构取决于它的创建方式和您使用的构建工具。
If you create by selecting File -> New ->Dynamic web project in eclipse, then you find the /WebContent directory.
如果在 eclipse 中通过选择 File -> New ->Dynamic web project 来创建,那么你会找到 /WebContent 目录。
If it is created using Maven, directory strutcure will be /src/main/webapp.
如果它是使用 Maven 创建的,则目录结构将为 /src/main/webapp。
Please go throuh herefor more information on Maven project strutcure.
请通过此处了解有关 Maven 项目结构的更多信息。