Adobe ColdFusion 8

getAttribute

Description

Retrieves the value of a passed attribute. Returns an empty string if the attribute does not exist (use attributeExists to test whether an attribute was passed to the tag). Use getAttribute(String,String) to return a default value rather than an empty string.

Returns the value of the attribute passed to the tag. If no attribute of that name was passed to the tag, an empty string is returned.

Category

Request interface

Syntax

public String getAttribute(String name)

See also

attributeExists, getAttributeList, getIntAttribute, getAttribute

Parameters

Parameter

Description

name

The attribute to retrieve (case-insensitive)

Example

The following example retrieves an attribute named DESTINATION and writes its value back to the user:

String strDestination = request.getAttribute("DESTINATION") ;
response.write( "The destination is: " + strDestination ) ;