Web Application Archive - Is a JAR file used to distribute JavaServer Pages, Java Servlets, Java classes, XML files, tag libraries and static Web pages (HTML and related files) that together constitute a Web application.
In software engineering, a WAR file (or Web application ARchive) is a JAR file used to distribute a collection of jsp pages, Java servlets, java classes, xml files, tag libraries, static web pages (html and related files) and other resources that together constitute a web application.
A WAR file may be digitally signed in the same way as a jar file in order to allow others to determine what source the code came from.
There are special files and directories within a WAR file.
The /WEB-INF directory in the WAR file contains a file named web.xml - the Web Application Deployment Descriptor - which defines the structure of the web application. If the web application is only serving JSP files, the web.xml file is not strictly necessary.
If the web application uses servlets, then the servlet container uses web.xml to ascertain to which servlet a URL request will be routed to. web.xml is also used to define context variables which can then be referenced within the servlets.
Environmental dependencies which the deployer is expected to set up can also be defined in this file. An example of an environmental dependency is a dependency on a mail session used to send email. The servlet container is responsible for providing this service.