Contents | Prev | Next


Attribute Directive

Declares attributes of custom actions defined in tag files. Used in tag files only.

JSP Syntax

<%@ attribute   name="attribute-name"
   [ required="true | false" ]
   [ fragment="true | false" ]
   [ rtexprvalue="true | false" ]
   [ type="java.lang.String | a non-primitive type"]
   [ description="text" ]
%>

OR

<jsp:directive.attribute attributeDirectiveAttrList />

where attributeDirectiveAttrList is the same as the list for JSP syntax

XML Syntax

<jsp:directive.attribute attributeDirectiveAttrList />

where attributeDirectiveAttrList is the same as the list for JSP syntax

Examples

The Duke's Bookstore example includes a custom tag, called shipDate, that is defined in a tag file, shipDate.tag. The tag file includes an attribute directive that declares the shipDate tag's attribute, shipping:

<%@ attribute name="shipping" required="true" %>

Here is an example of the shipDate tag used in the bookreceipt.jsp page:

<sc:shipDate shipping="${param.shipping}" /> 

Description

The attribute directive allows the declaration of attributes for custom tags in tag files. This is analogous to the attribute element of a TLD file.

Attributes



Contents | Prev | Next

Copyright © 2004, Sun Microsystems, Inc. All rights reserved.