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

The JSP Tag Handler Class

Finally, we need a tag handler for the <my:tabLabel> custom action. It’s a very simple class:

package com.mycompany.jsf.taglib;

import javax.faces.webapp.UIComponentTag;

public class TabLabelTag extends UIComponentTag {

    public String getComponentType( ) {
        return "com.mycompany.TabLabel";
    }

    public String getRendererType( ) {
        return "javax.faces.Link";
    }
}

The TabLabelTag class extends UIComponentTag, the same way as the tag handler classes we developed in Chapter 13. It implements the getComponentType() and getRendererType() methods to return the values needed by the superclass to create and configure the component. That’s all, because this custom action doesn’t provide any attributes for customization of the component or the renderer.

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