Opentopia Directory Encyclopedia Tools

War (file format)

Encyclopedia : W : WA : WAR : War (file format)


In computing, a WAR file (short for Web ARchive) is a ZIP file used to distribute a set of Java classes.

A WAR may contain JSPs, HTML and related files, servlets, and tag libraries.

There are special files and directories within a WAR file.

A WAR file is packaged using the same format as a JavaARchive (JAR file) file.

A WAR file may be digitally signed in the same way as a JAR file in order to assert that the code is trusted.

The /WEB-INF directory in the WAR file contains a file named web.xml 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 which servlet a URL request should be routed to. web.xml is also used to define context variables which can be referenced within the servlets and it is used to define environmental dependencies which the deployer is expected to set up. An example of this is a dependency on a mail session used to send email. The servlet container is responsible for providing this service.


HelloServlet mypackage.HelloServlet

HelloServlet /HelloServlet

Resource reference to a factory for javax.mail.Session instances that may be used for sending electronic mail messages, preconfigured to connect to the appropriate SMTP server. mail/Session javax.mail.Session Container

The /WEB-INF/classes directory is on the ClassLoader's classpath. This is where .class files are loaded from when the web application is executing. Any JAR files placed in the /WEB-INF/lib directory will also be placed on the ClassLoader's classpath.

External links

See also

 


From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.

Search Titles
0123456789
ABCDEFGHIJ
KLMNOPQRST
UVWXYZ?

E-mail this article to:

Personal Message: