Home arrow Java & J2EE arrow Page 7 - Introduction to JavaServer Faces, Part 3

More javax Packages - Java

This chapter has been leading us gently through the JavaServer Faces technology. More importantly, in it, Budi teaches ushow to write an online survey application to get a feel for how this great technology works. This chapter prepares you for the next chapters by introducing the JSF Application Programming Interface (API) and the Application Configuration file. This excerpt comes from chapter two of JavaServer Faces Programming, by Budi Kurniawan (McGraw-Hill/Osborne, ISBN 0-07-222983-7, 2004).

  1. Introduction to JavaServer Faces, Part 3
  2. Wrtiting the JSP Files for the Page Navigation Example
  3. Creating the Application Configuration File for the Page Navigation Example
  4. Compiling and Running the Page Navigation Example
  5. Introducing the JSF Application Programming Interface (API)
  6. javax Packages
  7. More javax Packages
By: McGraw-Hill/Osborne
Rating: starstarstarstarstar / 21
March 22, 2004

print this article



The javax.faces.lifecycle Package
The javax.faces.lifecycle package contains classes and an interface that have something to do with the request processing lifecycle. There are two classes in this package: Lifecycle and LifecycleFactory. As explained earlier in this chapter, the Lifecycle object is the object that processes a JSF request. The Lifecycle object is represented by the javax.faces.lifecycle.Lifecycle class. The LifecycleFactory class is responsible for creating a Lifecycle instance.

The only interface in this package is ViewHandler. This interface defines a mechanism by which the Render Response phase of the request processing lifecycle can support different response-generation technologies. 

The javax.faces.render Package
The javax.faces.render package contains three classes: Renderer, RenderKit, and RenderKitFactory. A Renderer is responsible for converting the internal representation of a UI component into something that is understood by the JSF client. When JSF is used in a Web application, a Renderer sends HTML tags to the browser as the representation of a UI componentís state. A Renderer normally can render one UI component, so there are always many Renderer objects for the various standard UI components used in a JSF application.

A RenderKit represents a collection of Renderer instances. The JSF implementation comes with the default RenderKit.The RenderKitFactory is a factory object that returns a RenderKit instance.

Renderers are discussed in Chapter 12.

The javax.faces.tree Package
The javax.faces.tree package contains the Tree and TreeFactory classes. The Tree class represents a component tree. The TreeFactory is responsible for creating Tree instances.

The javax.faces.validator Package
The javax.faces.validator package contains the Validator interface that you implement to write your custom validator. It also contains a number of standard validator classes: DoubleRangeValidator, LengthValidator, LongRangeValidator, RequiredValidator, and StringRangeValidator. Validators and input validation are discussed in Chapter 9.

The javax.faces.webapp Package
The members of the javax.faces.webapp package are classes that are required for integrating JSF into Web applications. The most important class in this package is the FacesServlet class. An instance of this class is required by each JSF application to manage the request processing lifecycle. Its job description includes obtaining a FacesContext instance and passing it to the Lifecycle object for processing.

Another member, UIComponentTag, is a base class that you need to extend to create a tag handler that handles a JSP custom action that is related to a UI component. You can see this class used in Chapters 12 and 13.

This chapter provided a gentle introduction to JSF. Its main objective was to give you the experience of running your first JSF applications. You got an idea of how JSF works, without going into all of the details yet. You will learn more about JSF processing in later chapters.

In this chapter, you learned the most important characteristic of JSF applications that makes them different from other servlet/JSP applications: their event-driven nature. You also built three simple JSF applications that illustrate the component tree, event processing, input validation, and page navigation. The last section of this chapter offered a general overview of the JSF API, which you will be using to develop JSF components in the next chapters.

Buy this book now!Remember: This is part three of the second chapter of JavaServer Faces Programming, by Budi Kurniawan (McGraw-Hill/Osborne, ISBN 0-07-222983). If you've enjoyed what you've seen here, click on the "Buy it now!" banner to pick up a copy today!
Buy this book!

>>> More Java & J2EE Articles          >>> More By McGraw-Hill/Osborne

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- More Java Bugs Lead to More Attacks
- Oracle's Java One Brings News, Surprises
- Oracle Patches Java Runtime Environment
- Apple Syncs Java Update with Oracle
- Spring 3.1 Java Development Framework Compat...
- Jelastic Java PaaS Availability and Pricing ...
- NetBeans 7.1 Released, Supports JavaFX 2
- SolarWinds Releases Newest Version of Java M...
- Free Monitoring Tool for Java Apps on Heroku
- Heroku Adds JCloud Platform Support, Java 7 ...
- Java SE 8 Speculation in Full Swing
- Java SE 7 Now Available
- New JVM Language and Java Reporting Tool
- Java 7 Release Update and New Eclipse Toolkit
- The Best Java Netbeans IDE Plugins

Developer Shed Affiliates


Dev Shed Tutorial Topics: