Karim Kiswarday,
Since
JSP,
Servlet and
JSF components are used to concentrate solely on presentation logic, it makes sense to put them into a separate module (as WAR file). The web related artifacts (Facelets, backing beans, servlet class files, JSP files, supporting class files, GIF and HTML files, and a web application deployment descriptor) go into a Web Archive (WAR) file which represents the Web module.
By automated build task like
ANT, we can easily deploy the application by single command.
Java EE 6 improved lot to simplify
EJB deployment as well. You no need to create seperate JAR file for EJBs, just copy .class into WAR file.
[WAR] The deployment process expands the EAR/WAR file into a temporary directory and (conceptually), the compressed EAR/WAR file is considered to be the application.
[Expanded directory] You can expand the EAR/WAR file manually, and then deploy the expanded directory structure, which becomes your working directory.
Why WAR/EAR deployment?
Application isolation
Separate class loaders
Problems encountered by one application have no effect on other applications
Choosing the option (WAR or Expanded directory) is depends on your project complexity. But it is always better to use WAR deployment to to
test your production issues.
Thanks