Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

we can deploy a folder instead of jar or war what is the difference

 
sai prasanna
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all

whats the use of creating jar or war file? we can deploy domain folder directly
what's the use of deploying jar or war file instead of domain folder? what is the difference between jar (or) war

thanks in advance
 
Albin Joseph
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

That is up to the container. You can deploy a folder instead of WAR file in Weblogic and Tomcat. The only thing is that the folder must follow the correct directory structure. If you want to deploy it on some other place or like that , the WAR will be easy to handle I think.

WAR means WEB ARCHIVE. JAR :- JAVA ARCHIVE.
WAR is an Web Aapplication archive and contains JSPs, "normal" static files (HTML, images, etc.), servlets, tag libraries, and such.


JAR is the "normal" Java Aapplication archive, but in this context it usually contains EJBs instead of code libraries or runnable (e.g. from outside an application container) applications
 
Rahim Vindhani
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Albin Joseph:
Hi

That is up to the container. You can deploy a folder instead of WAR file in Weblogic and Tomcat. The only thing is that the folder must follow the correct directory structure. If you want to deploy it on some other place or like that , the WAR will be easy to handle I think.

WAR means WEB ARCHIVE. JAR :- JAVA ARCHIVE.
WAR is an Web Aapplication archive and contains JSPs, "normal" static files (HTML, images, etc.), servlets, tag libraries, and such.


JAR is the "normal" Java Aapplication archive, but in this context it usually contains EJBs instead of code libraries or runnable (e.g. from outside an application container) applications



.jar files are simple compressed files. you can put classes inside it.
While .war is also compressed file but it has to follow some directory structure as given below.

WAR file structure -
The static HTML files and JSPs are stored in the top level directory.
The Servlet and related class files must be stored in the WEB-INF/classes directory.
Any auxiliary library JAR files must be stored in the WEB-INF/lib directory.
The deployment descriptor is stored as a file named web.xml in the WEB-INF directory.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic