Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Using JSF technology for XForms applications

Faheem Khan (fkhan872@yahoo.com), Software Consultant, Independent
Faheem Khan is an independent software consultant specializing in enterprise application integration (EAI) and B2B solutions.

Summary:  Interested in learning how JavaServer Faces and XForms technology can work together in a server-side application? This comprehensive hands-on tutorial by Java enterprise developer Faheem Khan examines how XForms authoring requirements fit into the JSF architecture. The author begins with a solid overview of JSF technology, then identifies the tasks you must perform if you plan to use JSF technology for XForms authoring, and demonstrates the development of a JSF tag library capable of authoring XForms markup. Throughout the tutorial, he guides your learning with a sample application to help you see the concepts put to work in a real-world application. Note: This tutorial is comprehensive and will take a significant time investment to complete.

Date:  03 Feb 2005
Level:  Introductory PDF:  A4 and Letter (1440 KB | 200 pages)Get Adobe® Reader®

Activity:  14849 views
Comments:  

About this tutorial

What is this tutorial about?

This tutorial explains and demonstrates the use of JavaServer Faces (JSF) technology to develop XForms applications. The JSF API (JSR-127) allows enterprise Java™ developers to build user interfaces for their server-side applications. XForms (a W3C recommendation) is an XML application that provides a framework for designing XML-based data entry forms.

This tutorial covers XForms authoring requirements in a server-side Java application. It provides the inside-out picture of the JSF technology and shows how XForms authoring requirements fit into the JSF architecture. It also lists the tasks required if developers are going to use JSF technology for XForms authoring and demonstrates the development of a JSF tag library capable of authoring XForms markup.

We will also develop a sample application (XForms-JSF shopping cart) so you can see the concepts put to work in a real-world application.

JSF technology provides the API for authoring user interfaces, and XForms defines the markup that needs to be produced. Therefore, it is natural to expect that many Java application developers will need to author XForms markup using the JSF API. That's why we have chosen XForms as our sample application in this tutorial. However, the concepts presented are applicable to all types of JSF applications, so we've provided sample code to help answer your JSF technology questions.


Should I take this tutorial?

To take this tutorial, you should be a Java programmer with some knowledge of JavaBeans and the JavaServer Pages (JSP) technologies. This knowledge is necessary to understand most of the coding details and examples. You also need to be familiar with XML.

This tutorial will help you:

  • Understand the JSF architecture
  • Know how the JSF framework internally works
  • Know what is happening inside a JSF application
  • Comprehend the different phases of a JSF application
  • Develop your own JSF tag library

This tutorial is not for readers who simply want to use the existing JSF core and HTML tag libraries. If you'd like to learn more about the existing JSF tag libraries, there are some excellent resources available on developerWorks, as detailed in Resources.


Tutorial topics

This tutorial is divided into the following sections:

  • Section 1 is the introduction and overview.

  • Section 2 covers the XForms authoring requirements in server-side Java applications. To cover the authoring requirements, we'll use a shopping cart application scenario, and present the flow of data and user interactions in an XForms application. then we provide a list of requirements to fulfill if you are to use XForms in a server-side Java application.

  • Section 3 offers a high-level view of the JSF architecture. This section lists the components required to build a JSF application. It covers many of the core JSF technology concepts without going into the low-level details of each concept.

  • Section 4 provides low-level details of JSF technology concepts.

  • Section 5 discusses the two important components you will build in almost all your JSF applications: model beans and event handlers. This section demonstrates the development of model beans to hold application data and event handlers to handle JSF events. By the end of Section 5, you should have enough knowledge about JSF technology to start building your own JSF tag libraries.

  • Section 6 demonstrates how you can use JSF technology to fulfill the server-side requirements of XForms applications. This section will also present the strategy for XForms-JSF technology integration and demonstrate this strategy by developing three XForms-JSF components.

  • Section 7 walks you through the development of many more XForms-JSF components using the concepts we learned in Section 6. At the end of this section, we will demonstrate how to build Java Archive (JAR) files to distribute your own tag libraries.

  • Finally, in sections 8 and 9, you'll put your JSF and XForms technology knowledge to the test by building a comprehensive real-world application.

Code samples and installation requirements

To run the sample applications, you will need the following:

  • J2SE V1.4.2
  • J2EE V1.4.0 Update 1
  • An application server
  • An XForms browser

I tested the sample applications using J2SE V1.4.2, J2EE V1.4 (Update 1), Sun Java System Application Server Platform Edition V8, and Forms Player V1.0 (XForms browser) on Microsoft® Windows® 2000 Professional Edition Service Pack 2. You should be able to use any J2EE 1.4-compliant application server.

The sample applications are available in the source code download for this tutorial. This download contains three zip files: section6.zip, section7.zip, and section9.zip (see Resources). These files contain code for the sample applications developed in their respective sections. The steps to try the sample applications in an individual zip file are discussed in their relevant sections.

1 of 12 | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Java technology
ArticleID=131918
TutorialTitle=Using JSF technology for XForms applications
publish-date=02032005
author1-email=fkhan872@yahoo.com
author1-email-cc=jaloi@us.ibm.com