SunQuest
 
       Java
  Home arrow Java arrow Page 5 - Introduction to JavaServer Faces, Part...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

Introduction to JavaServer Faces, Part 3
By: McGraw-Hill/Osborne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 19
    2004-03-22

    Table of Contents:
  • Introduction to JavaServer Faces, Part 3
  • Wrtiting the JSP Files for the Page Navigation Example
  • Creating the Application Configuration File for the Page Navigation Example
  • Compiling and Running the Page Navigation Example
  • Introducing the JSF Application Programming Interface (API)
  • javax Packages
  • More javax Packages

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Introduction to JavaServer Faces, Part 3 - Introducing the JSF Application Programming Interface (API)


    (Page 5 of 7 )

    The JSF implementation consists of various interfaces and classes that you can use to write event listeners, validators, custom components, and so on. These interfaces and classes are grouped into the following packages:

    • javax.faces
    • javax.faces.application
    • javax.faces.component
    • javax.faces.context
    • javax.faces.convert
    • javax.faces.el
    • javax.faces.event
    • javax.faces.lifecycle
    • javax.faces.render
    • javax.faces.tree
    • javax.faces.validator
    • javax.faces.webapp
    Each package is briefly described in the following sections. Bear in mind that this is only a general introduction to the classes and interfaces in the packages. You will get more details about using these packages in the upcoming chapters, which discuss specific topics related to the classes and interfaces.

    The javax.faces Package
    The javax.faces package contains the FactoryFinder and FacesException classes. The FactoryFinder is responsible for discovering all factory objects specified in the JSF API. An example of a factory object is the javax.faces.context.FacesContextFactory object, which is responsible for creating FacesContext instances. You probably will never need to use the FactoryFinder class during your career as a JSF programmer.

    On the other hand, the FacesException class, which is a subclass of java.lang. RuntimeException, encapsulates general JSF exceptions. You will often need to throw an instance of this class in your JSF classes.

    The javax.faces.application Package
    The javax.faces.application package contains important classes such as Action, NavigationHandler, and Application, as well as the Message interface. The Action class represents an object that performs a task and can return a String. The NavigationHandler class handles page navigation.

    The Application class represents a per-Web-application singleton object to which JSF can register objects that provide functionality required by JSF. As an example, the default NavigationHandler object that manages page navigation is registered with the Application object.

    The Message interface represents a validation or other message. For example, a validator will add a Message object to the FacesContext if the validation of the local value of a component fails. The javax.faces.application.MessageImpl class is the concrete implementation of the Message interface.

    The javax.faces.component Package
    The javax.faces.component package provides interfaces and classes that represent the standard UI components in JSF. The most notable member of this package is the UIComponent interface, which every UI component must implement. A convenience base class that implements this interface is UIComponentBase. Then there are other classes that represent UI components, such as UIForm, UICommand, UIGraphic, UIInput, UIOutput, UIPanel, and UISelectItem. These components are discussed in Chapters 4 and 5.

    The javax.faces.context Package
    The javax.faces.context package contains classes and interfaces that define per-request state information. The FacesContext class represents all of the per-request state information that is needed by the Lifecycle object during the request processing lifecycle. A FacesContext contains many other important objects, such as the component tree and the ExternalContext class.

    The ExternalContext class, also a member of this package, is there so that JSF does not need to depend on any particular container. Thanks to this class, JSF can run in either a servlet or a portlet. In a servlet environment, you can get information contained in the ServletContext, ServletRequest, and ServletResponse objects through the instance of ExternalContext.

    Other important members of this package are FacesContextFactory and MessageResources. FacesContextFactory is responsible for the creation of FacesContext objects. The MessageResources class represents a collection of message templates that help in constructing localized messages. Chapter 11 discusses how you can achieve internationalization and localization of your JSF applications.

    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 Articles
    More By McGraw-Hill/Osborne


     

       

    JAVA ARTICLES

    - Adding Images With iTextSharp
    - Adding Columns With iTextSharp
    - Creating Simple PDF Files With iTextSharp
    - The Spring Framework: Understanding IoC
    - Introducing the Spring Framework
    - Java Classes
    - Completing the Syntactic Comparison of Java ...
    - Syntactic Comparison of Java and C/C++
    - Java Statements
    - Conditionals, Expressions and Other Java Ope...
    - Java Operators
    - Primitive Data Types and Basic Language Rule...
    - Java and Object-Oriented Programming
    - Java Beginning Programming
    - Gaming Development Setup





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway