HTML and CSS Reference
JSF Component Libraries
In this chapter, you will learn briefly how to utilize JSF component libraries in order to produce nifty-looking web
applications. You will be introduced to two of the most famous JSF open-source component libraries, which are
PrimeFaces and RichFaces. Although going into the details of these frameworks is outside the scope of this topic
because these frameworks are really big and cannot be covered in one single chapter, we will give you an overview
of the different components shipped with each of the component libraries and how to use these libraries in order to
create nifty-looking JSF 2.2 web applications.
PrimeFaces is an open-source JSF component library that has many different capabilities. PrimeFaces has a rich set of
components, built-in Ajax based on the standard JSF 2.0 Ajax APIs, and Ajax Push support using web sockets; finally,
PrimeFaces includes Mobile User Interface renderkit that allows the JSF developer(s) to create JSF applications on
mobiles. PrimeFaces also includes a skinning framework that has more than 35 built-in themes.
In order to configure PrimeFaces, you need to download the PrimeFaces jar ( primefaces-xxx.jar ). There are
two ways to download this jar: you can either download it from http://primefaces.org/downloads.html or if you
are a Maven user you can define it as a Maven dependency. The group ID of the dependency is org.primefaces and
artifact ID is PrimeFaces as shown in the following.
In addition to the preceding configuration you also need to add PrimeFaces Maven repository to the repository
list of your Maven configuration so that Maven can download it as follows.
PrimeFaces needs Java 5+ runtime and a JSF 2.x implementation as mandatory dependencies. There are some
optional libraries that you may include in order to support some features in PrimeFaces as shown by Table 9-1 .