Lastly, inside the src directory,
create another directory named app, which is where our Java source files will be.
By the end of this, you should have the directory structure shown in Figure 2-5 underneath
/webapps.
CHAPTER 2 n GETTING TO KNOW DWR 52
Figure 2-5. Directory structure of our first webapp (eventually) using DWR
The next thing we need to do is get the JAR files this application will need and add them.
First, when we want to compile the source code for the application, we??™ll need access to the
Servlet APIs. These are present in a JAR file named, not surprisingly, servlet-api.jar. This can
be found in the /lib directory. Copy that JAR file over into simpleapp/WEB-INF/src
(we don??™t want to put it in simpleapp/WEB-INF/lib because it??™s provided to our webapp via
Tomcat, so it would be redundant if added to the classpath for the application and could actually
cause conflicts).
From Code to Executable: Ant Build Script
The next step is to create an Ant build script file that we can use to compile our source code
(which we haven??™t written yet, of course). The build script can be seen in Listing 2-1. You
should save this to a file named build.
Pages:
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139