[英]What is the difference between Web Fragment Project and Dynamic Web Project?
What is the difference between Web Fragment Project and Dynamic Web Project on Eclipse? Eclipse上的Web Fragment Project和Dynamic Web Project有什么区别? Which one would you recommend to use for building a clean structural website? 您建议使用哪一个来建立一个干净的结构网站?
IBM defines Web Fragment as follows: IBM 将Web Fragment定义如下:
A web fragment is a logical partitioning of the web application in such a way that the frameworks being used within the web application can define all the artifacts without requiring you to edit or add information in the
web.xml
. Web片段是Web应用程序的逻辑分区,使得Web应用程序中使用的框架可以定义所有工件,而无需您在web.xml
编辑或添加信息。
Furthermore: 此外:
A web fragment is a mechanism for either defining or extending the deployment descriptor of a web application by means of pluggable library jars that contain both the incremental deployment information (in the
web-fragment.xml
) and potentially any related or relevant classes. Web片段是一种机制,用于通过可插入的库jar来定义或扩展Web应用程序的部署描述符,这些库包含增量部署信息(在web-fragment.xml
)以及可能包含任何相关或相关的类。 The web fragment is also packaged as a library (jar), with theweb-fragment.xml
in theMETA-INF
directory. Web片段也打包为库(jar),其中web-fragment.xml
位于META-INF
目录中。 Consequently, the web fragment project is essentially a Utility project, with the addition of a web fragment facet to it. 因此,Web片段项目本质上是一个实用程序项目,其中添加了一个Web片段构面。 The web fragment facet enables you to add relevant context-sensitive functionality to the fragment project. 通过Web片段构面,您可以向片段项目添加相关的上下文相关功能。
Essentially, Web Fragments (introduced in Servlet 3.x) allows you to create a reusable portion (or fragment) of the deployment descriptor, web.xml
. 从本质上讲,Web Fragments(在Servlet 3.x中引入)允许您创建部署描述符web.xml
的可重用部分(或片段)。
So, if you want to create a complete, dynamic web application, create a "Dynamic Web Project" in Eclipse. 因此,如果要创建完整的动态Web应用程序,请在Eclipse中创建“动态Web项目”。 Essentially, you need web.xml
for the application server/container to deploy your application and "Dynamic Web Project" helps with this approach. 实际上,您需要web.xml
来为应用程序服务器/容器部署您的应用程序,“Dynamic Web Project”有助于这种方法。
I hope this helps. 我希望这有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.