April 2004
Intermediate to advanced
606 pages
20h 4m
English
All custom components must
be
registered in the faces-config.xml file.
Here’s how you register the
UITabLabel component:
<faces-config>
...
<component>
<component-type>
com.mycompany.TabLabel
</component-type>
<component-class>
com.mycompany.jsf.component.UITabLabel
</component-class>
</component>
...
</faces-config>The <component> element contains two
mandatory nested elements. The
<component-type> element assigns the
component a unique identifier and the
<component-class> holds the fully qualified
component class name. As you may recall from Chapter 6, the code that creates components does so
by calling the Application
createComponent() method. It takes the component
type identifier as the argument and returns an instance of the class
mapped to the identifier.
Read now
Unlock full access