Writing a custom JSF renderer

From Foochal

Jump to: navigation, search

The UIViewRoot (denoted by the <f:view> tag) is mapped to exactly one render kit factory. This render kit factory is initialized and configured once and then associated with the root view. Each time a component needs to be rendered, a renderer is looked up in the render kit factory using the component family and render type.

Here are the various options for writing your own renderer:

Write your own render kit factory

Use existing render kit factory and add your renderer to this factory using a different component family

<render-kit>
 <renderer>
   <description>Renderer for the credit card component.</description>
    <component-family>myfamily</component-family>
    <renderer-type>mytype</renderer-type>
    <renderer-class>
      my.Renderer
   </renderer-class>
 </renderer>
</render-kit>

Use existing render kit factory and add your renderer to this factory using a different render type


Personal tools