Before you start
The needs of Java EE application and Web services developers are well served by the tight integration among the free tools that make up the Kick-start your Java apps suite: Eclipse, DB2 Express-C 9.5, and WebSphere Application Server Community Edition 2.0 (Application Server). The companion tutorial to this one, Kick-start your Java apps, Part 1: Free software, fast development, covers how well these tools work together for Java EE software development.
Increasingly, Java developers are experimenting with highly interactive Web-based user interfaces, including alternatives that don't require the use of a conventional Java EE container. Such exploration often forces you to learn an unproven programming language, work with beta-quality tooling, and gamble on deployment technology that hasn't withstood the test of time.
It might surprise you to learn that the production-grade, robust set of free IBM-backed tools that you use for your Java EE development tasks can also be your best buddy in exploring the realm of alternative user-interface development. The great news is that all your code — lightweight or conventional — can take advantage of the rich, easy-to-use feature set of Eclipse, the maturity and robustness of DB2-Express C, and the world-class deployment support of Application Server.
This tutorial shows you how to move an application from a conventional design to one based on Asynchronous JavaScript and XML (Ajax) technology — all within the friendly and familiar environment of the Kick-start your Java apps suite.
You'll start this tutorial by creating an employee-information panel using standard JSP and servlet technology. You'll do all development and testing using the Kick-start your Java apps suite. You'll design the application in Eclipse and then deploy and test it on Application Server. The application interactively fetches and displays employee information, including a photo, from a DB2 Express-C 9.5 database.
Then the tutorial discusses some of the limitations of the JSP application design and shows how a lightweight Ajax-based solution can help to overcome them. It introduces basic Ajax concepts and a popular Java toolkit called Direct Web Remoting (DWR) (see Resources). You'll convert the application to a lightweight design. The redesigned application resides within an HTML page hosted on Application Server acting as a simple Web server, accessing DB2 Express C database information directly using Ajax and JavaScript Object Notation (JSON) serialization.
The tutorial guides you through:
- Developing an employee-information panel using conventional JSP and servlet technologies
- Handling the display of GIF photos from DB2 binary large object (BLOB) fields using a custom servlet
- Being introduced to Ajax and Direct Web Remoting
- Migrating the employee-information panel to a lightweight Ajax design
- Coding the Java-side support code for the new application
- JavaScript coding using the DWR utilities library
- Testing the new interactive employee-information panel
By the end of the tutorial, you'll appreciate some of the fundamental differences between conventional Java EE application design and the highly interactive Ajax-based approach. You'll also become comfortable with using the Kick-start your Java apps suite to explore present and future Java-based development frameworks.
You should be familiar with Java development in general and server-side Java development specifically. This tutorial assumes you are familiar with basic Java EE deployment concepts, such as deployment descriptors and WAR archives. You should also be familiar with JSP programming and using tag libraries, such as the JavaServer Pages Standard Tag Library (JSTL). This tutorial assumes that you understand the general operations of a relational database and have programmed JDBC applications. It also assumes that you have completed the Kick-start your Java apps: Free software, fast development tutorial.
To follow along and try out the code, you need working installations of:
- Sun's Java SE JDK 5 update 15 or the IBM SDK for Java Version 5 SR6 or later.
- The Kick-start your Java apps suite:
- DB2 Express-C 9.5
- Application Server version 2.0.0.1
- Eclipse 3.3 and the WTP Server Adapter for Application Server V. 2.0
- The employee-listing application you built in Kick-start your Java apps: Free software, fast development.
- The DB2 Express-C 9.5 sample database.
- DWR. Detailed instructions for experimenting with DWR are included in this tutorial.
The recommended system hardware configuration for trying out the tutorial:
- A system supporting the JDK/JRE listed above with at least 1GB of main memory (2GB recommended).
- At least 10MB of additional free disk space to install the software components and examples.
The instructions in the tutorial are based on a Windows® operating system. All of the tools and techniques covered in the tutorial also work on Linux® and Unix® systems.





