Using AJAX4JSF to add Ajax features
In the first two phases of this five-part tutorial series, we studied Javaserver™faces (JSF), a new Java™ based framework that can be simplified to Java Platform, Enterprise Edition (Java EE) The process of building a graphical user interface (GUI) for an application. We built and successfully deployed a simple JSF application on Apache Geronimo and learned how to integrate the Apache Tomahawk (which provides several JSF 100% compliant components) with the application to improve the interface. In this tutorial (part 3rd), you will learn about the Sun AJAX4JSF Open source framework, which adds asynchronous javascript™+ XML (Ajax) functionality to the JSF application without writing any JavaScript code. You will use AJAX4JSF to improve the sample application and create an Ajax-enabled front-end.
Before you start
This tutorial teaches Java programmers How to build highly interactive Java EE applications on Apache Geronimo using JSF components. This tutorial assumes that readers will use the Eclipse IDE as a development platform.
About this tutorial
This tutorial explains the Sun AJAX4JSF Open source Framework, which adds Ajax capabilities to JSF applications without having to write any JavaScript code. We will continue to improve the sample application developed in part 2nd, adding a utility that transforms the temperature and graphically displays the results.
About this series
This tutorial is part 3rd of the five-part tutorial series on using JSF to build the Apache Geronimo application. The entire series of tutorials includes the following sections:
Part 1th: Building basic applications using Eclipse and Apache Myfaces Core describes how to use the JSF standard Apache myfaces Implementation and Geronimo (a free Application server from Apache). This tutorial explains how to use the Eclipse IDE's Web Tool Platform (WTP) to build a JSF application.
Part 2nd: Using Tomahawk in JavaServer Faces shows how to integrate Apache Tomahawk in a Geronimo application. Tomahawk offers several custom components that are compatible with JSF 100%.
Part 3rd: Using AJAX4JSF in JavaServer Faces demonstrates how to use the Sun's free open source Framework AJAX4JSF Add asynchronous JavaScript + XML to the Geronimo application (Ajax function
Part 4: Using the application Development Framework (ADF) Faces Extended JSF explains how to integrate components from the ADF Faces into the Geronimo application. Oracle's ADF Faces is a very rich set of UI components built on JSF (it is part of the code donated to Apache with the name Trinidad).
Part 5th: Incorporate JSF applications with spring integration to show how to integrate JSF applications with the spring framework. Spring is a popular framework that makes it easier for Geronimo developers to build Java EE applications.
System Requirements
To learn this tutorial, you need the following tools:
The 2nd part of the source code, we will improve the application.
Geronimo,apache Java EE Server project. As needed, Geronimo offers Tomcat and Jetty two styles. We use the Jetty style (version 1.1) because it's a little bit smaller.
JSF implementation of the Myfaces,apache. Please download the core version (without Tomcat) from Apache. The version used in this tutorial is the 1.1.3 version.
Tomahawk, which provides additional components and input validators for myfaces, and is compatible with JSF 100%.
Eclipse, an extensible open source IDE that can support a large number of languages and platforms.
Eclipse Web Tools Platform (WTP), which adds support to eclipse for XML and JavaScript editing and basic support for JSF.
AJAX4JSF, this is the Sun's open source framework for adding AJAX functionality to existing JSF applications. The current version at the time of writing this article is 1.0RC4.
Install Java 1.4 or later in your system. The Eclipse binaries have their own Java runtime, but Geronimo and myfaces are not (with the runtime making the download archive size significantly larger).
ajax4jsf--Overview
AJAX4JSF allows developers to add AJAX functionality to JSF applications without requiring JavaScript or replacing existing components with Ajax graphics parts. This package also allows images to be generated dynamically when using the Java 2D library. Ajax is a programming technique that handles situations where only part of a page needs to be processed without reloading the entire page. The benefits of this approach include reducing processing time on the server and speeding up the responsiveness of the client.
Similar to Tomahawk, AJAX4JSF provides a set of tags that can be easily used with JSF tags. When you improve on the Developer Forum Signup sample Application After this tutorial, you will discuss examples of these tags and how to integrate AJAX4JSF with Eclipse. Next, you will learn about each component that makes up this library, the limitations you must keep in mind when you use it, and how to add AJAX4JSF to your Eclipse project.