PacktLib: JSF 2.0 Cookbook

JSF 2.0 Cookbook


About the Author

About the Reviewer


Using Standard and Custom Converters in JSF


Working with implicit and explicit conversions

Standard converters for numbers

Standard converters for date and time

Converters and NULL values

Creating and using a custom converter

Using custom converters for h:selectOneMenu

Binding converters to backing bean properties

RichFaces and standard converters

RichFaces and custom converters

Instance variables in converters

Client-side converters with MyFaces Trinidad

Using Standard and Custom Validators in JSF


Using a standard validator

Getting ready

How to do it...

How it works...

See also

Customizing error messages for validators

Creating a custom validator

Binding validators to backing bean properties

Validating forms with RichFaces rich:beanValidator

Validating forms with RichFaces rich:ajaxValidator

Apache MyFaces Commons validators

Bean validation with f:validateBean

Enforcing a value's presence with f:validateRequired

Using regular expressions with f:validateRegex

File Management


Downloading files using Mojarra Scales

Multi-file upload using Mojarra Scales

File upload with Apache MyFaces Tomahawk

AJAX multi-file upload with RichFaces

Downloading with PrimeFaces 2.0

PPR multi-file upload with PrimeFaces 2.0

Extracting data from an uploaded CSV file

Exporting data to Excel, PDF, CVS, and XML



Working with the JSF Security project

Using the JSF Security project without JAAS Roles

Using secured managed beans with JSF Security

Using Acegi/Spring security in JSF applications

Custom Components


Building a "HelloWorld" JSF custom component

Renderers/validators for custom components

Adding AJAX support to JSF custom components

Using Proxy Id library for dynamic IDs

Using JSF ID Generator

Accessing resources from custom components

Custom components with Archetypes for Maven

RichFaces CDK and custom components

Composite custom components with zero Java

Creating a login composite component in JSF 2.0

Building a spinner composite component in JSF 2.0

Mixing JSF and Dojo widget for custom components



A first JSF 2.0-AJAX example

Using the f:ajax tag

Installing and using Dynamic Faces in NetBeans 6.8

Using the inputSuggestAjax component

ajax4jsf—more than 100 AJAX components

Writing reusable AJAX components in JSF 2.0

PrimeFaces, CommandLink, and CommandButton

Internationalization and Localization


Loading message resource bundles in JSF

Using locales and message resource bundles

Message resource bundles without f:loadBundle

Working with parameterized messages

Accessing message resource keys from a class

Providing a theme to a Visual Web JSF Project

Displaying Arabic, Chinese, Russian, and so on

Selecting a time zone in JSF 2.0

JSF, Images, CSS, and JS


Injecting CSS in JSF

JSF, CSS, and tables

JSF and dynamic CSS

Integrating JavaScript and JSF

Getting a JSF inputText value from JavaScript

Working with JSF hidden fields from JavaScript

Passing parameters from JS to JSF (client to server)

Passing parameters from JSF to JS (server to client)

Opening a pop-up window using JSF and JS

Passing parameters with HTTP GET within the URL

Communication between parent pop-up windows

Populating a JS load function with JSF values

Dynamic images with PrimeFaces

Cropping images with PrimeFaces

Working with rss4jsf project

Using resource handlers

JSF—Managing and Testing


Managing JSF with Faces Console

Testing JSF applications with JSFUnit

JSFUnit and Ant


A JSF and JMeter issue

Working with JSF Chart Creator



Installing Facelets under JSF 1.2 (or JSF 1.1)

Facelets aliasing components

Facelets templating

Creating composition components in JSF 2.0

Passing sub-elements to composition components

Passing actions to composition components

JSF 2.0 Features


JSF 2.0 annotations

The JSF 2.0 exception handling mechanism

Bookmarking JSF pages with PrettyFaces

JSF declarative event handling

URLs based on specified navigation outcome

JSF view parameters

JSF 2 and navigation cases

Mixing JSF with Other Technologies


Configuring Seam with JSF

An overview of Seam JSF controls

Mixing JSF and JSTL

Integrating JSF and Hibernate

Integrating JSF and Spring

Mixing JSF and EJB (JPA)

Configuring JSF-related Technologies

Configuring JSF-related Technologies

Configuring JSF-related Technologies

Configuring JSF-related Technologies

Configuring JSF-related Technologies

Configuring JSF-related Technologies

Configuring JSF-related Technologies

Configuring JSF-related Technologies

Configuring JSF-related Technologies

Configuring JSF-related Technologies