Registering a Custom Component - The Java EE 5 Tutorial (original) (raw)
2. Using the Tutorial Examples
3. Getting Started with Web Applications
5. JavaServer Pages Technology
7. JavaServer Pages Standard Tag Library
10. JavaServer Faces Technology
11. Using JavaServer Faces Technology in JSP Pages
12. Developing with JavaServer Faces Technology
13. Creating Custom UI Components
14. Configuring JavaServer Faces Applications
Application Configuration Resource File
Using the managed-bean Element
Initializing Properties Using the managed-property Element
Referencing an Initialization Parameter
Initializing Array and List Properties
Initializing Managed Bean Properties
Registering Custom Error Messages
Registering Custom Localized Static Text
Registering a Custom Validator
Registering a Custom Converter
Registering a Custom Renderer with a Render Kit
Registering a Custom Component
Basic Requirements of a JavaServer Faces Application
Configuring an Application with a Deployment Descriptor
Identifying the Servlet for Life Cycle Processing
Specifying a Path to an Application Configuration Resource File
Specifying Where State Is Saved
Restricting Access to JavaServer Faces Components
Turning On Validation of XML Files
Including the Required JAR Files
Including the Classes, Pages, and Other Resources
15. Internationalizing and Localizing Web Applications
16. Building Web Services with JAX-WS
17. Binding between XML Schema and Java Classes
19. SOAP with Attachments API for Java
21. Getting Started with Enterprise Beans
23. A Message-Driven Bean Example
24. Introduction to the Java Persistence API
25. Persistence in the Web Tier
26. Persistence in the EJB Tier
27. The Java Persistence Query Language
28. Introduction to Security in the Java EE Platform
29. Securing Java EE Applications
31. The Java Message Service API
32. Java EE Examples Using the JMS API
36. The Coffee Break Application
37. The Duke's Bank Application
![]() |
---|
Home | Download | PDF | FAQ | Feedback
Registering a Custom Component
In addition to registering custom renderers (as explained in the preceding section), you also must register the custom components that are usually associated with the custom renderers.
Here is the component element from the application configuration resource file that registers AreaComponent:
DemoArea com.sun.bookstore6.components.AreaComponent alt java.lang.String coords java.lang.String shape java.lang.StringThe component-type element indicates the name under which the component should be registered. Other objects referring to this component use this name. For example, the component-typeelement in the configuration for AreaComponent defines a value of DemoArea, which matches the value returned by the AreaTag class’s getComponentType method.
The component-class element indicates the fully qualified class name of the component. Theproperty elements specify the component properties and their types.
If the custom component can include facets, you can configure the facets in the component configuration using facet elements, which are allowed after the component-class elements. See Registering a Custom Renderer with a Render Kit for further details on configuring facets.
Copyright © 2010, Oracle and/or its affiliates. All rights reserved. Legal Notices