Java
  Home arrow Java arrow Page 2 - Introducing Java Server Faces (JSF)
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
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

Introducing Java Server Faces (JSF)
By: A.P.Rajshekhar
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 7
    2006-10-17

    Table of Contents:
  • Introducing Java Server Faces (JSF)
  • JSF: Terminology Continued
  • JSF: Steps for Implementation
  • JSF in the Real World

  • 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


    Introducing Java Server Faces (JSF) - JSF: Terminology Continued


    (Page 2 of 4 )

    Validator

    A Validator does what its name suggests. It validates user input. In other words, it checks whether the input data is in an acceptable form. The main consumer of time in web development is checking the user data through JavaScript or Java or both. Most of the time, the validation routines are like reinventing the wheel. It is here that the power of frameworks come into force.

    JSF provides three ways to validate: at the UI component level, via Validator methods in backing beans, or in validator classes. For example, if the zip code field has to be validated, then the logic can be embedded at any of three levels, but when using the logic, the framework abstracts out all the details. When the component is used, the logic is executed at runtime. A single UI Component can have one or more Validators.

    Backing Beans

    Backing Beans are specialized JavaBeans that collect values from UI Components and implement the event listeners. In other words, Backing Beans control and define the interaction between the UI and the model, and hence are the controllers in JSF. Generally, Backing Beans contain references to the UI Components and the event handlers corresponding to the components. Using the event handlers/listeners, the properties of the UI Components can be processed and the UI can be manipulated as a result of the processing. They can be linked with UI Components declaratively using XML.

    Converter

    Apart from validations, the other major error-prone area in web development is conversion, that is conversion of one data type to another. In JSF it is the duty of a Converter to convert the values of UI Components to and from String form. A UI Component can only be associated with a single Converter.

    Events and Listeners

    Any framework based on the event driven paradigm would be failing its intention if event handling is not provided. JSF uses the Swing event/listener model which in turn is based on the JavaBeans event/listener model. UI Components generate events which can be handled by event listeners. The listeners have to be registered so that they can be used to handle events.

    Messages

    Messages are information that's displayed to the user. Just about any part of the application (backing beans, validators, converters, and so on) can generate information or error messages that can be displayed to the user. A message consists of text that includes a summary or details and a severity level. Localization can be applied to the messages to tailor them to a user's current language. Many times messages can be linked to a particular UI Component.

    Navigation

    By definition, the act of moving from one page to another is called navigation. JSF provides a powerful navigation system. The Faces Navigation System works in tandem with the Events and Listeners. For a given page, a navigation rule defines what outcomes can be valid, and what pages to load based on those outcomes. Each specific mapping between an outcome and a page is called a navigation case. Faces Navigation heavily relies on Navigation case.

    That was a birds' eye view of the key pieces of JSF. In the next section, I will be discussing the steps required to set up a running application based on JSF.

    More Java Articles
    More By A.P.Rajshekhar


       · JSF has brought event driven paradigm to the web application development. In this...
       · Hi,On the last page you have mentioned struts-config, I think it should be...
     

    JAVA ARTICLES

    - Deploying Multiple Java Applets as One
    - Deploying Java Applets
    - Understanding Deployment Frameworks
    - Database Programming in Java Using JDBC
    - Extension Interfaces and SAX
    - Entities, Handlers and SAX
    - Advanced SAX
    - Conversions and Java Print Streams
    - Formatters and Java Print Streams
    - Java Print Streams
    - Wildcards, Arrays, and Generics in Java
    - Wildcards and Generic Methods in Java
    - Finishing the Project: Java Web Development ...
    - Generics and Limitations in Java
    - Getting Started with Java Web Development in...


     
    Best Practices for Windows Vista Migration Presentation
    Dell and Microsoft recently held a series of face-to-face seminars entitled, &qu....

     
    Creating a Culture for Code Reuse
    If you oversee development teams you know that like it or not proprietary and ex....

     
    Keys to Web Application Acceleration: Advances in Delivery Systems
    Accelerate Web apps by up to 5x. Ensure significantly faster access to the Web a....

     
    Optimizing Application Monitoring
    Tired of finding out from your customers that you're offline? This white paper e....

     
    Solaris to Solaris Migration -- Migrating applications from Sun SPARC to Dell PowerEdge R900
    This comprehensive Migration Guide reviews the approach that Principled Technolo....

     





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT