PacktLib: JSF 2.0 Cookbook

JSF 2.0 Cookbook

Credits

About the Author

About the Reviewer

Preface

Using Standard and Custom Converters in JSF

Introduction

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

Introduction

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

Introduction

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

Security

Introduction

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

Introduction

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

AJAX in JSF

Introduction

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

Introduction

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

Introduction

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

Introduction

Managing JSF with Faces Console

Testing JSF applications with JSFUnit

JSFUnit and Ant

JSFUnit API

A JSF and JMeter issue

Working with JSF Chart Creator

Facelets

Introduction

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

Introduction

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

Introduction

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

Index