Download
FAQ
History
HomeHomeNext API
Search
Feedback
Divider

Steps for Creating a Custom Component

Before describing how the image map works, it helps to summarize the basic steps needed to create an application that uses custom components. You can apply the following steps while developing your own custom component example.

  1. Write a tag handler class that extends javax.faces.webapp.FacesTag. In this class, you need:
    • A getRendererType method, which returns the type of your custom renderer, if you are using one (explained in step 4).
    • A getComponentType method, which returns the type of the custom component.
    • An overrideProperties method, in which you set all of the new attributes of your component.
  2. Create a tag library descriptor (TLD) that defines the custom tag.
  3. Create a custom component class
  4. Include the rendering code in the component class or delegate it to a renderer (explained in step 6).
  5. If your component generates events, queue the event on the FacesContext.
  6. Delegate rendering to a renderer if your component does not handle the rendering.
    1. Create a custom renderer class by extending javax.faces.render.Renderer.
    2. Register the renderer to a render kit.
    3. Identify the renderer type in the component tag handler.
  7. Register the component
  8. Create an event handler if your component generates events.
  9. Declare your new TLD in your JSP page and use the tag in the page.
Divider
Download
FAQ
History
HomeHomeNext API
Search
Feedback
Divider

All of the material in The Java(TM) Web Services Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.