Schlagwort-Archive: Web Archive

Mein WAR

hat nichts mit einem Heiligen Krieg oder Rosenkrieg zu tun. Ist weder ein Edit-, Delete- oder Wheel-War und hat auch nichts mit „war“ zu tun. Ich spreche nicht von einem MMORPG, nicht von der Wassermann-Reaktion und schon gar nicht von der „White Aryan Resistance“, sondern natürlich von einem Web Application Archive.

Das ist ein Dateiformat, das beschreibt, wie eine vollständige Webanwendung nach der Java-Servlet-Spezifikation in eine Datei im JAR- bzw. ZIP-Format verpackt wird. Solche Dateien haben immer die Endung „.war“ und werden daher umgangssprachlich auch „WAR-Datei“ genannt.

Auf oben genannter Seite findet man auch ein sehr einfaches Beispiel für die Struktur eines sehr einfachen Web Archives.:
/index.html
/gaestebuch.jsp
/images/logo.png
/WEB-INF/web.xml
/WEB-INF/classes/org/wikipedia/Util.class
/WEB-INF/classes/org/wikipedia/MainServlet.class
/WEB-INF/lib/util.jar
/META-INF/MANIFEST.MF

Im J2EE-Tutorial liest man dazu:

Web clients are packaged in Web application archives. In addition to Web components, a Web application archive usually contains other files, including the following:

* Server-side utility classes (database beans, shopping carts, and so on). Often these classes conform to the JavaBeans component architecture.
* Static Web content (HTML, image, and sound files, and so on).
* Client-side classes (applets and utility classes).

Web components and static Web content files are called Web resources.

A WAR has a specific directory structure. The top-level directory of a WAR is the document root of the application. The document root is where JSP pages, client-side classes and archives, and static Web resources are stored.

The document root contains a subdirectory called WEB-INF, which contains the following files and directories:

* web.xml: The Web application deployment descriptor
* Tag library descriptor files (see Tag Library Descriptors)
* classes: A directory that contains server-side classes: servlets, utility classes, and JavaBeans components
* lib: A directory that contains JAR archives of libraries (tag libraries and any utility libraries called by server-side classes).

You can also create application-specific subdirectories (that is, package directories) in either the document root or the WEB-INF/classes directory.