Table of Contents
Components are building blocks used to build other components including a web page. These building blocks can be nested to form a hierarchy of container and contained components. This hierarchy is captured in fragments within every component that is a part of the hierarchy. Every component holds a reference to its containing component and a reference map to its contained components.
Contained components, often known as embedded components, always render within the context of their containing component and contribute to their immidiate containing component.
![]() | Note |
|---|---|
| Web pages are top level components that can only serve as containers and never be embedded within another component. | |
Component definitions typically involve a template, a specification and a JavaBeans class. Although components can be defined just from a template or from a specification and a JavaBeans class.
Components that do not have a template are called primitive components. These components generate any markup that needs to be rendered from within the component class. Most framework components are primitive components.
Component Definition.
<component-specification |
| The root element of a component specification. It identifies the defining component as a non-page, meaning embeddable, component. |
| The component class. This class is one of either the framework classes, AbstractComponent or BaseComponent, or a user-defined subclass of one of these framework classes. |
There is a lot involed in component definitions. We'll cover them in detail later.