The same Servlet Specification defines a very convenient way to package Java web applications—a Web Archive (WAR) file. This is basically the same as a JAR file, which is an archived collection of files, The difference is that the WAR file contains the whole web application's structure.
A WAR file can be distributed conveniently, and when it comes to deployment, this file can be simply uploaded to a servlet container, and the latter will either automatically unpack the contained web application or run it straight from the WAR file.