Book Image

Mastering JavaServer Faces 2.2

By : Anghel Leonard
Book Image

Mastering JavaServer Faces 2.2

By: Anghel Leonard

Overview of this book

Table of Contents (20 chapters)
Mastering JavaServer Faces 2.2
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
The JSF Life Cycle
Index

Chapter 7. JSF and AJAX

JSF and AJAX have been a great team for a long time. The potential of this combination has been heavily exploited by many JSF extensions (Ajax4Jsf, OmniFaces, PrimeFaces, RichFaces, ICEfaces, and so on) that provide many AJAX built-in components, extend AJAX default capabilities, increase AJAX security and reliability, and add more control to developers who need to manipulate the bowels of AJAX mechanism.

By default, JSF contains a JavaScript library that encapsulates AJAX methods for dealing with AJAX requests or responses. This library can be loaded in the following two ways:

  • Using the <f:ajax> tag, the built-in AJAX library is loaded implicitly.

  • Using jsf.ajax.request(), the AJAX library is loaded explicitly and developers have access to AJAX code. This approach is commonly used when the default AJAX behavior must be altered. It should be performed only by developers with high expertise, because modifying the default AJAX behavior may lead to undesirable issues...