简体   繁体   中英

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? Which one would you recommend to use for building a clean structural website?

IBM defines Web Fragment as follows:

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 .

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. The web fragment is also packaged as a library (jar), with the web-fragment.xml in the META-INF directory. Consequently, the web fragment project is essentially a Utility project, with the addition of a web fragment facet to it. The web fragment facet enables you to add relevant context-sensitive functionality to the fragment project.

Essentially, Web Fragments (introduced in Servlet 3.x) allows you to create a reusable portion (or fragment) of the deployment descriptor, web.xml .

So, if you want to create a complete, dynamic web application, create a "Dynamic Web Project" in Eclipse. Essentially, you need web.xml for the application server/container to deploy your application and "Dynamic Web Project" helps with this approach.

I hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM