The Java EE 7 Tutorial
14.1 Attributes of a Composite Component
You define an attribute of a composite component by using the composite:attribute
tag. Table 14-1 lists the commonly used attributes of this tag.
Table 14-1 Commonly Used Attributes of the composite:attribute Tag
Attribute | Description |
---|---|
Specifies the name of the composite component attribute to be used in the using page. Alternatively, the |
|
Specifies the default value of the composite component attribute. |
|
Specifies whether it is mandatory to provide a value for the attribute. |
|
Specifies a subclass of Note: Method expressions are similar to value expressions, but rather than supporting the dynamic retrieval and setting of properties, method expressions support the invocation of a method of an arbitrary object, passing a specified set of parameters and returning the result from the called method (if any). |
|
Specifies a fully qualified class name as the type of the attribute. The |
The following code snippet defines a composite component attribute and assigns it a default value:
<composite:attribute name="username" default="admin"/>
The following code snippet uses the method-signature
element:
<composite:attribute name="myaction" method-signature="java.lang.String action()"/>
The following code snippet uses the type
element:
<composite:attribute name="dateofjoining" type="java.util.Date"/>