background image

The Render Kit

<< Component Rendering Model | The UI Component Tags >>
<< Component Rendering Model | The UI Component Tags >>

The Render Kit

A render kit defines how component classes map to component tags that are appropriate for a
particular client. The JavaServer Faces implementation includes a standard HTML render kit
for rendering to an HTML client.
The render kit defines a set of Renderer classes for each component that it supports. Each
Renderer
class defines a different way to render the particular component to the output defined
by the render kit. For example, a UISelectOne component has three different renderers. One of
them renders the component as a set of radio buttons. Another renders the component as a
combo box. The third one renders the component as a list box.
Each JSP custom tag defined in the standard HTML render kit is composed of the component
functionality (defined in the UIComponent class) and the rendering attributes (defined by the
Renderer
class). For example, the two tags in
Table 10­1
represent a UICommand component
rendered in two different ways.
TABLE 10­1
UICommand
Tags
Tag
Rendered As
commandButton
commandLink
The command part of the tags shown in
Table 10­1
corresponds to the UICommand class,
specifying the functionality, which is to fire an action. The button and hyperlink parts of the
tags each correspond to a separate Renderer class, which defines how the component appears
on the page.
The JavaServer Faces implementation provides a custom tag library for rendering components
in HTML. It supports all the component tags listed in
Table 10­2
. To learn how to use the tags
in an example, see
"Adding UI Components to a Page Using the HTML Component Tags" on
page 327
.
TABLE 10­2
The UI Component Tags
Tag
Functions
Rendered As
Appearance
column
Represents a column of data in
a UIData component.
A column of data in an
HTML table
A column in a table
User Interface Component Model
The Java EE 5 Tutorial · September 2007
302