Download
FAQ
History
PrevHomeNext API
Search
Feedback
Divider

Packaging Web Applications

A Web application must be packaged into a WAR in certain deployment scenarios and whenever you want distribute the Web application to an external enviroment.

You package Web application into a WAR by executing the jar command in a directory laid out in the format of a Web module or by using the Ant war task. This tutorial uses the second approach. To build and package the hello1 application into a WAR named hello1.war:

  1. In a terminal window, go to <INSTALL>/jwstutorial13/examples/web/hello1/.
  2. Run ant build. This target will spawn any necessary compilations and copy files to the <INSTALL>/jwstutorial13/examples/web/hello1/build/ directory.
  3. Run ant package. This target creates a WAR in the directory <INSTALL>/jwstutorial13/examples/web/hello1/dist/.

A sample hello1.war is provided in <INSTALL>/jwstutorial13/examples/web/provided-wars/.

Divider
Download
FAQ
History
PrevHomeNext API
Search
Feedback
Divider

All of the material in The Java(TM) Web Services Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.