Skip to main content

Instructor-led training

JavaServer Faces (5 day) Training in Fostoria, Ohio

This comprehensive course shows Java programmers how to build web applications with JavaServer Faces 2.0.

What you'll learn

This comprehensive course shows Java programmers how to build web applications with JavaServer Faces 2.0. We develop the best-practice concepts that are formalized by the JSF architecture, from model/view/controller to the UI component framework and request-handling lifecycle. Students start to discover that there is a "JSF way" of doing things, and we learn not just APIs and tag libraries but the habit of slicing application logic into its most reusable forms: managed beans, event listeners, converters, validators, and more. br/ Students acquire a firm command of JSF development, learning to work with JSF's list and table components, building reusable composite components, and building Ajax applications. Simple, high-level Ajax functionality is covered, and students also work more directly with JSF's JavaScript API and resource-management framework.

Private Training for Teams

This course is offered as private, instructor-led training for organizations, onsite in Fostoria, Ohio or live online. Dates, delivery format, and course content are arranged around your team's requirements.

This course is not currently scheduled as a public class for individual enrollment.

Request Group Training

Prerequisites

This course is intended primarily for experienced Java application developers. Page authors, component developers, and others who may have little or no Java experience (but perhaps are stronger on HTML, JavaScript, and JSP) may well find this to be a valuable training experience, though without solid Java skills many of the coding exercises will be difficult to follow.

Course Outline

Chapter 1. Overview

  • Java EE and Web Applications
  • Perspectives: Servlets and JSP
  • Perspectives: MVC Frameworks
  • Perspectives: AWT and JFC
  • JSF Value Proposition
  • JSF Configuration
  • Issues with JSP and JSF
  • Facelets

Chapter 2. Lifecycle

  • The JSF Request/Response Cycle
  • Lifecycle Phases
  • Phase Listeners
  • The FacesContext Class
  • Who Does What
  • Partial Request Cycles

Chapter 3. UI Components

  • The UIComponent Class
  • Behavioral Interfaces
  • The Core and HTML Tag Libraries
  • Relationship to CSS
  • ID, Client ID, and Label
  • UISelectItem(s)
  • Navigating the UI Tree
  • The binding Attribute

Chapter 4. Page Navigation

  • View Selection
  • Navigation Rules
  • Implicit Navigation
  • Problems with POSTback
  • Post/Redirect/Get
  • Support for HTTP GET
  • Conditional Navigation

Chapter 5. Managed Beans

  • JavaBeans and JSF
  • Backing Beans
  • Configuring Managed Beans
  • @ManagedBean and Related Annotations
  • The Unified Expression Language
  • Value and Method Expressions
  • Implicit Objects

Chapter 6. Scopes

  • Managed-Bean Scopes
  • Lifecycle Annotations
  • View Parameters
  • The Flash

Chapter 7. Dependency Injection

  • Managed Properties
  • Values, Lists, and Maps
  • Using Dynamic Expressions
  • Dependencies and Bean Scopes
  • The @ManagedProperty Annotation

Chapter 8. Facelets

  • Migrating from JSP
  • View Definition Languages
  • Facelets
  • Tag Libraries
  • Writing and Using Custom Tags

Chapter 9. Events and Listeners

  • JSF Event Model
  • Event Types and Timing
  • Event Queueing
  • ActionEvent and ActionListener
  • Action Methods
  • Connecting Controllers to Beans
  • ValueChangeEvent and ValueChangeListener
  • Deferring Event Processing
  • Limitations of FacesListeners

Chapter 10. Lists and Tables

  • Working with Collections
  • Why We Don't Use
  • vs.
  • Defining Columns and Facets
  • One Command Per Row
  • Reading the Row Number
  • Pseudo-Maps
  • Working with Persistent Data
  • Concurrency and Caching
  • Limiting the Scope of Queries
  • Paging

Chapter 11. Converters

  • The Converter Interface
  • Life of a Datum
  • Standard Converters
  • Custom Converters
  • The @FacesConverter Annotation
  • Timing of Conversion
  • Representing Persistent Objects by ID

Chapter 12. Validators

  • The Validator Interface
  • Standard Validators
  • Using Regular Expressions
  • Producing Error Messages
  • Message Keys
  • Presenting Error Messages
  • Posting Error Messages from Anywhere
  • Custom Validators
  • The @FacesValidator Annotation
  • Validating Multiple Inputs
  • JSR-303 Support: "Bean Validation"

Chapter 13. Resources

  • Resource Libraries
  • Deploying Images, Scripts, and Stylesheets
  • Addressing Resources

Chapter 14. Composites

  • Limitations of Custom Tags
  • Composite Components
  • Encapsulation
  • Deploying and Using Composites
  • Interface and Implementation
  • Impact on the UI Tree
  • Attributes
  • Retargeting

Chapter 15. Ajax

  • What is Ajax?
  • The XMLHttpRequest Object
  • Ajax and the JSF Lifecycle
  • Using
  • execute and render Attributes
  • Ajax Listeners

Chapter 16. The JSF JavaScript API

  • The JSF JavaScript API
  • Trigering Ajax Requests
  • Refining with Callbacks
  • onevent and onerror Attributes
  • The Ajax Request/Response Process
  • Using Hidden Inputs
  • Other JavaScript Functions

What makes JavaServer Faces hard to master

The Java is rarely the obstacle. The difficulty is that JSF is a component framework with its own request lifecycle, so code you write runs at a point in a cycle you don't control. A common misconception is to treat a JSF page like a JSP: a template that runs top to bottom. The syllabus corrects this early, before the component and bean chapters depend on it.

  • Lifecycle first (Chapter 2). The request/response cycle, its phases, phase listeners, FacesContext and partial request cycles. Many later bugs, such as a value that never reaches a bean or a validator that never fires, are lifecycle-ordering problems.
  • The UI tree (Chapter 3). UIComponent, ID versus client ID, the binding attribute and navigating the tree. These are needed again for Ajax targeting and composites.
  • Navigation and state (Chapters 4-7). Navigation rules, implicit and conditional navigation, Post/Redirect/Get, managed beans, the Unified Expression Language, scopes, the flash, view parameters and managed properties. Scope is a frequent source of bugs, especially when a bean in one scope depends on a bean in another.
  • Per-field processing (Chapters 9-12). Events and listeners, converters, validators and message handling. Timing matters: conversion and validation happen before your action method runs, and the course covers deferring event processing and validating multiple inputs.
  • Reuse and Ajax (Chapters 13-16). Resource libraries, composite components with retargeting, execute and render, and the JavaScript API with its onevent and onerror callbacks. Ajax in JSF is partial lifecycle processing, so it only makes sense once Chapter 2 is understood.

Chapter 10 adds data-handling concerns: tables over collections, persistent data, concurrency and caching, limiting query scope and paging.

Who it suits and what to take around it

The course is aimed mainly at experienced Java application developers. Page authors and component developers who are stronger in HTML, JavaScript and JSP can benefit, but without solid Java skills many coding exercises will be hard to follow. Training managers should plan for that mix when assembling a group.

Chapter 10 touches persistent data, so teams that also design the data layer may add Fast Track to EJB 3.2 (JEE 7 level) and JPA2 to cover EJB and JPA in depth. Teams whose Faces front end will sit alongside service endpoints may follow with Developing RESTful Services Using Java. Other Java options are on the Java Programming courses and learning guide page.

Private training can be customized and tailored to the technology versions your organization uses, onsite or live online. You can request a training proposal to discuss your environment.

Illustrative scenarios

The scenarios below are illustrations of how the course material can be applied. They are not descriptions of specific organizations or of the course's lab exercises.

  • Moving JSP pages to Facelets. A team might maintain JSP-based pages and need to migrate them. The Facelets chapters (migrating from JSP, view definition languages, custom tags) and the Chapter 1 discussion of issues with JSP and JSF address this.
  • A reusable input component. A team might repeat the same group of fields on many screens. Composite components (interface versus implementation, attributes, retargeting) with custom converters and validators, including validation across multiple inputs, let it be written once and reused.
  • A searchable, paged table that updates in place. A team might show query results with one command per row and paging, refreshing only part of the page. This draws on the list and table chapter (columns, facets, row numbers, limiting query scope, paging) and on Ajax with execute and render and the JavaScript API callbacks.

AI coding assistants and JSF

AI coding assistants are useful for repetitive JSF code: bean skeletons with getters and setters, a first draft of a custom converter or validator, Facelets markup for a table, or message-bundle entries. They are weaker where behavior depends on context the assistant cannot see.

  • Lifecycle and timing. Generated code may assume a value is available in a phase where it isn't yet, or put logic in a getter that runs several times per request. Phase listeners help you see what actually happens.
  • Scopes and injection. Generated beans often pick a scope by habit. Check them against the syllabus topics on managed-bean scopes and on dependencies between scopes.
  • Mixed generations of APIs. Suggestions may combine JSP-era tags, Facelets tags and annotations from different versions. Verify each against the version your project uses.
  • Ajax targeting. Wrong client IDs in render and execute are a typical failure, because they depend on the component tree and naming containers.

To verify, run the page and inspect the lifecycle, test converters and validators with both valid and invalid input, check Post/Redirect/Get behavior on refresh, and review any generated code for injection and insecure-input risks.

Frequently asked questions

What level is this course and what background is expected?

It is a general-level, five-day course for experienced Java application developers. Page authors and component developers with HTML, JavaScript and JSP skills but little Java may benefit, though many coding exercises will be hard to follow without solid Java skills.

What does the course cover?

The syllabus covers the JSF request/response lifecycle, UI components, page navigation, managed beans and scopes, dependency injection, Facelets, events, lists and tables, converters, validators including Bean Validation support, resources, composite components, Ajax and the JSF JavaScript API.

Can the course be delivered privately for our team?

Yes. HSG delivers private training for organizations, either onsite at the client's location or live online.

Can the content be customized or matched to our versions?

Private courses can be customized and tailored to the technology versions an organization uses, including current releases. Use the training proposal request to describe your environment and goals.

Training locations

JavaServer Faces (5 day) training across the U.S. and beyond.

We provide private JavaServer Faces (5 day) training for organizations, onsite at your location or live online, throughout the United States and internationally.

View all JavaServer Faces (5 day) training locations

Train your team with HSG

Private, instructor-led training customized for your organization.

  • Onsite or live online delivery
  • Customized curriculum
  • For a single employee or an entire team
  • Flexible scheduling
  • Experienced instructors
Request Group Training

Questions? Call us at 303.377.6176
or email info@hartmannsoftware.com

Ready to train your team?

Let's customize this training for your organization.

Tell us about your employees, your goals, and your preferred schedule. We'll prepare a training proposal covering scope, delivery format, and pricing.