4.3. Deploying Web Applications in WAR Files

WAR (Web ARchive) files provide a convenient way of bundling Web apps in a single file. Having a single large file instead of many small files makes it easier to transfer the Web application from server to server.

A WAR file is really just a JAR file with a.war extension, and you use the normal jar command to create it. For example, to bundle the entire widgetStore Web app into a WAR file named widgetStore.war, you would just change directory to the widgetStore directory and execute the following command.

jar cvf widgetStore.war * 

For simple WAR files, that’s it! However, in version 2.3 of the servlet API, you can create WAR files that designate that they need shared but nonstandard libraries installed ...

Get More Servlets and JavaServer Pages™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.