Contents > CFML Reference > ColdFusion Java CFX Reference > Request interface > getAttribute PreviousNext

getAttribute

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.

Request interface

public String getAttribute(String name)

attributeExists, getAttributeList, getIntAttribute, getAttribute

Parameter

Description

name

The attribute to retrieve (case-insensitive)

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

Contents > CFML Reference > ColdFusion Java CFX Reference > Request interface > getAttribute PreviousNext

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.