Why do we need WAR? if we can create JAR and deploy it on servlet container.
Asked
Active
Viewed 1,397 times
0
-
Or you can use Spring Boot and embed the container in a self-contained jar. – chrylis -cautiouslyoptimistic- Dec 06 '15 at 19:30
-
try putting some .war in an [.ear](http://stackoverflow.com/questions/1594667/war-vs-ear-file) for increased fun. – zapl Dec 06 '15 at 19:33
1 Answers
4
They are all compressed files, if thats what you mean. But they are not all jars. The internal file layout are different between jar and war.
WAR (Web Archive) contains deployment descriptor (web.xml) plus jar dependencies plus your classes and other resources. A typical web container unpacks the deployed WAR file into the the webapp's directory before running the webapp.
So put it very simple: - war may contain jar, etc. - jar may contain classes, etc.

Abdelhak
- 8,299
- 4
- 22
- 36