General J2EE: EAR archive Vs WAR & Jar's
We can deploy EJB as a JAR file, and create a WAR file that includes the previous JAR and some JSPs (this is enough for deploying applications).
- Posted by: Shahul Hameed
- Posted on: February 21 2005 08:51 EST
But we can also deploy as an EAR file. What is the advantage of that?
could somebody clear me this thing
The difference is all in what you are trying to accomplish.
The WAR file is for deploying web applications, thus the name Web Application aRchive. This is for when you want to allow HTTP(S)/WML/VXML clients to connect to your application through the typical internet domain. Your web application acts as a delegate (think Business Delegate or Session Facade inside your business tier) to your EJB. You can deploy multiple EJBs, via JAR files, inside your one WAR file.
The EAR file is for deploying your EJB as standalone, or separate from your web application. In other words you don't need a web application to be running for a client to access your EJB as an enterprise service. You are exposing the EJB to clients, more than likely through an EJB client JAR you have provided for them.
what if we only using Spring and ORMs? Any advantage for EAR compared to WAR?