A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://docs.oracle.com/javaee/6/tutorial/doc/gkhwv.html below:

Attributes of a Composite Component

You define an attribute of a composite component by using the composite:attribute tag. Table 12-1 lists the commonly used attributes of this tag.

Table 12-1 Commonly Used Attributes of the composite:attribute Tag

Attribute

Description

name

Specifies the name of the composite component attribute to be used in the using page. Alternatively, the name attribute can specify standard event handlers such as action, actionListener, and managed bean.

default

Specifies the default value of the composite component attribute.

required

Specifies whether it is mandatory to provide a value for the attribute.

method-signature

Specifies a subclass of java.lang.Object as the type of the composite component’s attribute. The method-signature element declares that the composite component attribute is a method expression. The type attribute and the method-signature attribute are mutually exclusive. If you specify both, method-signature is ignored. The default type of an attribute is java.lang.Object.

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).

type

Specifies a fully qualified class name as the type of the attribute. The type attribute and the method-signature attribute are mutually exclusive. If you specify both, method-signature is ignored. The default type of an attribute is java.lang.Object.

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"/>

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4