3.1. Building and Deploying the Ajax ApplicationWe now have all the components required to build the example. If you have never used Ant, you are about to be surprised by a powerful tool.
The build.xml file presented in Example 3-3 builds the project and moves it to the tomcat/webapps directory; that's all Tomcat needs in order to begin running the web application. Make sure you have set TOMCAT_HOME to the directory where you installed Tomcat. Refer back to Chapter 1 for setup details. Example 3-3. build.xml
When you've created the build.xml file, you should be able to build and deploy the project with the following command: ant deploy 3.1.1. Directory StructureFor the build to work correctly, you must have the directory structure just right. Figure 3-1 shows the directory structure that I use with Eclipse. It can be modified, but build.xml should reflect the directory structure you are using. Figure 3-1. Directory structure for Ajax Character Decoder (first version) |