User Guide

1084 Chapter 8: ColdFusion Java CFX Reference
Syntax
public String getAttribute(String name)
See also
attributeExists
, getAttributeList, getIntAttribute, getAttribute
Parameters
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 ) ;
getAttributeList
Description
Retrieves a list of attributes passed to the tag. To retrieve the value of one attribute, use the
getAttribute method.
Returns an array of strings containing the names of the attributes passed to the tag.
Category
Request interface
Syntax
public String[] getAttributeList()
See also
attributeExists
, getAttributeList
Example
The following example retrieves the list of attributes, then iterates over the list, writing each
attribute and its value back to the user:
String[] attribs = request.getAttributeList() ;
int nNumAttribs = attribs.length ;
for( int i = 0; i < nNumAttribs; i++ )
{
String strName = attribs[i] ;
String strValue = request.getAttribute( strName ) ;
response.write( strName + "=" + strValue + "<BR>" ) ;
}
Parameter Description
name The attribute to retrieve (case-insensitive)