JSF is a J2EE technology that focuses on simplifying the building of web based user interfaces in Java. It builds on existing technologies, such as Servlets and JSP, but solves many of the issues that arise when using them directly by providing a standard component based user interface (UI) framework that can be leveraged by tools to provide a rich and easy-to-use development environment.

This course will quickly bring you up to speed with JSF. It includes numerous hands on labs that will have you building working JSF applications as well as important architectural concepts and practical instruction on how to use the many capabilities of the JSF framework.

The course includes a broad coverage of the most important JSF capabilities, including the JSF architecture, working with managed beans, the JSF Expression Language, the JSF core and HTML tag libraries, data tables, validation and conversion. It also includes overview of advanced technologies, such as using JSF and AJAX.

Upon completion on this course, participants will be ready to use JSF to create their own solutions in the most demanding situations. Note that class time will be equally divided between lecture and hands-on labs, and all labs are done using the JBoss Application Server as the server platform.

Course Duration: 3 days
Prerequisites:

Three to six months of hands-on Java web development strongly recommended.

Course Objectives:
  • Understand the shortcomings of servlets/JSP and the need for a framework like JSF
  • Understand MVC and the JSF architecture
  • Create and configure applications using JSF, including the FacesServlet and the faces-config.xml file
  • Understand and use managed beans to manage application data
  • Configure navigation rules for your web application
  • Create web pages using the JSF core and html tags and the JSF expression language
  • Lay out tables using the JSF h:datatable and associated tags
  • Handle action events, value change events and data model events
  • Use JSF Validators to validate your input data
  • Understand and use JSF data conversion
  • Understand the JSF request lifecycle and write phase listeners
  • Understand how AJAX and JSF can be used together
Course Outline:
  • Overview of Java EE and Java Web Applications
    • Java EE and Web App Overview
    • Servlet, Servlet Scopes
    • JSPs, JSP Lifecycle
    • Custom Tags, Tag Libraries, Taglib Directive
    • Model View Controller
  • Getting Started with JSF
    • JSF Overview
      • Purpose and Goals
      • JSF Architecture
      • JSF Views, Managed Beans, Controller, Configuration
    • Downloading and Installing JSF
    • Your First JSF Application
      • Setup, Configuration, Deployment
    • Server Setup and Use
    • Setting Up and Running JBoss AS
  • Managed Beans
    • Defining a Managed Bean
    • Managed Bean Lifecycle
    • <managed-bean> Elements in faces-config.xml
    • Managed Beans and JSF Forms
    • Managed Beans as Value Binding Expressions
    • JSF Expression Language (EL) and the Unified EL (JSF 1.2)
    • Value Binding Expressions
    • Method Binding Expressions
    • Implicit Objects
  • JSF Navigation
    • <navigation-rule> Configuration Issues
    • <navigation-case> and Nested Elements
    • How to Use the Navigation Rules
  • The JSF Tag Libraries
    • JSF Tag Library Overview
    • JSF Core tags <f:tagName>
    • JSF HTML tags <h:tagName>
    • Using the Most Common Form Controls
  • h:dataTable
    • <h:dataTable> Tag and Nested Tags <h:column>
    • Working with Collections of Type List or Array
    • Table Headers And Footers, f:facet
  • More About JSF Tags
    • Using <h:commandLink> and <h:outputLink>
    • Using the h:selectXxx Tags (e.g., h:selectManyListbox)
    • JSF Event Model (Action, Value Change and Data Model Listeners)
  • JSF Validation
    • Standard Validators
    • Required, validateDoubleRange, validateLongRange
    • Creating, Configuring and Using Custom Validators
  • JSF Conversion
    • Standard JSF Converters
    • convertDateTime, convertNumber
    • Custom Converters
  • JSF Lifecycle
    • Lifecycle Overview
    • Initial Requests and Postbacks
    • Restore View, Apply Request Values, Process Events, Process Validations, Update Model Values, Invoke Application, Render Response
    • renderResponse() and renderComplete()
    • Phase Listeners
  • Additional Topics
    • Backing Beans / UIComponents
    • JSF and CSS
    • JSF and JavaScript
    • Localization and Resource Bundles
    • Ajax4jsf – Using Ajax with JSF