Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between Web Fragment Project and Dynamic Web Project?

Tags:

java

eclipse

web

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?

like image 528
Chris Myung Hyun Kim Avatar asked Sep 04 '14 04:09

Chris Myung Hyun Kim


1 Answers

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.

like image 130
Buhake Sindi Avatar answered Sep 20 '22 07:09

Buhake Sindi