This tutorial is derived from
Marty Hall's world-renowned live J2EE training courses.
It is intended as a fast introduction to the basics of Ajax for people that already know how to write the server-side
part of the process using servlets and JSP. In particular, although this tutorial shows the code for
all of the servlets and JSP pages used (downloadable with the rest of the code), it does not explain the
server-side code in depth or discuss how to deploy it. For detailed tutorials on writing servlets and JSP and explanations
on how to deploy them on Tomcat, please see
these tutorials.
The PDF files in this tutorial contain the complete text of the original
PowerPoint files, so if your goal is learning Ajax, just stick
with this tutorial. However, as a service to instructors teaching
full-semester courses at accredited universities, coreservlets.com
will release the original PowerPoint files for free. Please
see the instructor materials page
for details.
This section provides a quick review of the server-side programming
topics that will be used throughout this tutorial. There are no
Ajax-specific topics in this first section. For more details on
server-side programming, see
the servlet and JSP tutorials.
org.json-utils.jar.
JAR file containing utilities from org.json. Downloaded latest
classes as of October 2008, compiled with Java 6, and put into a JAR file.
Put this JAR file in the WEB-INF/lib folder of your project.
json2.js. JavaScript utility
used if you want to send JSON objects to the server. Direct
link to file at json.org.
ajaxtags-blank.zip.
Blank Web app to be used as a starting point for apps that use
AjaxTags. Contains all required JAR files and JavaScript files.
Bundled as
an Eclipse project.
ajaxtags-demo.zip.
App that demonstrates many of the AjaxTags features.
Taken directly from the AjaxTags site, then bundled as
an Eclipse project.
GwtProject1.zip.
Main app used in the basic GWT section. It is built as
an Eclipse project that assumes you have GWT installed
in C:\My Documents\GWT\gwt-windows-1.4.62.
The Eclipse project links to several
files in the GWT installation directory, so
it will not run out of the box if you have GWT installed
in a different location. If
you have GWT installed in a different location, you could try
importing gwt-user.jar and junit.jar into your app.
But perhaps the easiest approach might be
to make a new project and copy the sample code to the new
project. For example:
Use projectCreator and applicationCreator to
build a GWT Eclipse project with this name, as
described in detail in the tutorial.
Go to the sample code here, navigate to the
src folder, select everything under
it (coreservlets, coreservlets.client, etc.), and
select Copy.
Go to your new project, navigate to the src folder,
delete everything under it, right-click on
src, and select Paste.
GwtTestProject.zip.
First "hello world" app used in the basic GWT section. This is
simply what you get when you run projectCreator and applicationCreator,
with no changes whatsoever.
GwtRpcProject.zip.
Main app used in the RPC section. It is built as
an Eclipse project that assumes you have GWT installed
in C:\My Documents\GWT\gwt-windows-1.4.62.
The Eclipse project links to several
files in the GWT installation directory, so
it will not run out of the box if you have GWT installed
in a different location. If
you have GWT installed in a different location, you could try
importing gwt-user.jar and junit.jar into your app.
But perhaps the easiest approach might be
to make a new project and copy the sample code to the new
project. For example:
Use projectCreator and applicationCreator to
build a GWT Eclipse project with this name, as
described in detail in the tutorial.
Go to the sample code here, navigate to the
src folder, select everything under
it (coreservlets, coreservlets.client, etc.), and
select Copy.
Go to your new project, navigate to the src folder,
delete everything under it, right-click on
src, and select Paste.
The following app assumes you have GWT installed
in C:\gwt-windows-1.5.3.
Edit the .launch file if you want to run this app directly, but your GWT installation
is in a different location. See installation directions in earlier section.
The following app assumes you have GWT installed
in C:\gwt-windows-1.5.3.
Edit the .launch file if you want to run this app directly, but your GWT installation
is in a different location. See installation directions in earlier section.