Java Reference
In-Depth Information
with the custom renderer. In this situation, you need a custom tag to go with the renderer
so that its tag handler can register the renderer on the standard component.
Custom components as well as custom renderers need custom tags associated with them.
However, you can have a custom tag without a custom renderer or custom component. For
example, suppose that you need to create a custom validator that requires extra attributes
on the validator tag. In this case, the custom tag corresponds to a custom validator and
not to a custom component or custom renderer. In any case, you still need to associate the
custom tag with a server-side object.
Table 6-1 summarizes what you must or can associate with a custom component, custom
renderer, or custom tag.
TABLE 6-1. Requirements for Custom Components, Custom Renderers, and Cus-
tom Tags
Understanding the Image Map Example
Duke's Bookstore includes a custom image map component on the index.xhtml page.
This image map displays a selection of six book titles. When the user clicks one of the
book titles in the image map, the application goes to a page that displays the title of the
selected book as well as information about a featured book. The page allows the user to
add either book (or none) to the shopping cart.
Why Use JavaServer Faces Technology to Implement an Image Map?
JavaServer Faces technology is an ideal framework to use for implementing this kind of
image map because it can perform the work that must be done on the server without re-
quiring you to create a server-side image map.
In general, client-side image maps are preferred over server-side image maps for several
reasons. One reason is that the client-side image map allows the browser to provide im-
Search WWH ::




Custom Search