Monday, June 11, 2007

JSF rendererType

The rendererType to use for rendering a JSF component really exists as a property in the component itself. We can call setRendererType(String rendererType); to set the rendererType.

When the component is being rendered, the appropriate renderer will be selected based on the rendererType. The runtime knows which renderer is mapped to a rendererType, because we map it in faces-config.xml. However, it can also be set in code, I believe.

When we use JSP tags to represent JSF components, then the tag handler class can also have a method getRendererType(); which returns the rendererType for that component. This is convenient because the JSF runtime will query the tag handler for the rendererType and will set it in the corresponding JSF component.

No comments: