A web module must be packaged into a WAR in certain deployment scenarios and whenever you want to distribute the web module. You package a web module into a WAR by executing the jar command in a directory laid out in the format of a web module, by using the Ant utility, or by using the IDE tool of your choice. This tutorial shows you how to use NetBeans IDE or Ant to build, package, and deploy the sample applications.
To build the hello2 application with NetBeans IDE, follow these instructions:
Select File->Open Project.
In the Open Project dialog, navigate to:
Select the hello2 folder.
Select the Open as Main Project check box.
Click Open Project.
In the Projects tab, right-click the hello2 project and select Build.
To build the hello2 application using the Ant utility, follow these steps:
In a terminal window, go to tut-install/examples/web/hello2/.
Type ant. This command will spawn any necessary compilations, copy files to the tut-install/examples/web/hello2/build/ directory, create the WAR file, and copy it to the tut-install/examples/web/hello2/dist/ directory.