O'Reilly logo

Mastering JavaServer Faces 2.2 by Anghel Leonard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Overriding JSF renders

The main responsibilities of a Renderer consists of generating the appropriate client-side markup, such as HTML, WML, and XUL, and converting information coming from the client to the proper type for the component.

JSF provides a set of built-in renders and has the capability to extend them with custom behavior. If you consider a proper workaround to override a built-in render, then perform the following steps:

  1. Extend the desired built-in renderer (for example, Renderer, TextRenderer, LabelRenderer, MessagesRenderer, and so on).
  2. Override the built-in renderer methods.
  3. Configure the new renderer in faces-config.xml or using the @FacesRenderer annotation.

Well, let's see some examples of writing a custom render. For example, let's ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required