Hi,
all the 'R' files (waR,eaR,jaR) are just an ordinary compressed (zipped)
java Classfiles (and if needed
other kind of files also). Then what is the speciality in them ? It makes the distribution of the
application easier.
ie. you have written an web application, with 100's of
JSP's and numerous Servlets, then what would
you do if your client wants your web application. You would zip/compress the root folder and send it. and
ask the client to unzip it and use it. But with these 'R' files, you just send this single file and user will
deploy them in the Server. They will not worry what to do with this archive file, they will just deploy.
This deploying task will differ from Server to Server, it may be a way in BEA WLS,another way in TOMCAT
.. and like that.
if you have only Web Components in your application (ie JSP's,Servlets and other static files like image,
..etc) you make a WAR out of them.
if you have only JAVA (
EJB's or Ordinary Java files , not Servlets) Components in your application
you make a JAR out of them.
if your application has both Web Components and Java Components, you make a WAR out of
web components,make a JAR out of java components and finally make an EAR out of your JAR & WAR.
as a Rule of Thumb, each of the 'R' files ,will have a Descriptor file in it, which tells the Server
what to do, when deployed.
WAR should have Web Descpritor web.xml
JAR should have EJB Descriptor ejb-jar.xml
EAR should have Application Descriptor application.xml
p.s:
Creation of these 'R' files are not Server specific. Same war/jar/ear file can be deployed in any Server
(if the jar contains EJB then its an exception, it cant be just like that deployed in any Server)