O'Reilly logo

JavaServer Faces by Hans Bergsten

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

Registering the Component and the Renderer

The components and its renderer are registered like this in the faces-config.xml file:

<faces-config>
  ...
  <component>
    <component-type>
      com.mycompany.Tree
    </component-type>
    <component-class>
      com.mycompany.jsf.component.UITree
    </component-class>
  </component>
  ...
  <render-kit>
    <renderer>
      <component-family>com.mycompany.Tree</component-family>
      <renderer-type>com.mycompany.Tree</renderer-type>
      <renderer-class>
        com.mycompany.jsf.renderer.TreeRenderer
      </renderer-class>
    </renderer>
  </render-kit>
  ...
</faces-config>

This is the same kind of declarations as you’ve seen earlier, with a <component> element for mapping the component type identifier to the component implementation class and a <renderer> element for mapping the combination of a component family and a renderer type to the renderer implementation class.

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