Getattributelist; Getintattribute - MACROMEDIA COLDFUSION MX 61-CFML Reference

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

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
member function.
getAttribute
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
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>" ) ;
}

getIntAttribute

Description
Retrieves the value of the passed attribute as an integer. Returns -1 if the attribute does not exist.
Use
attributeExists
getIntAttribute(String,int)
returning -1.
Returns the value of the attribute passed to the tag. If no attribute of that name was passed to the
tag, -1 is returned.
Category
Request interface
Syntax
public int getIntAttribute(String name)
,
getAttributeList
to test whether an attribute was passed to the tag. Use
to return a default value rather than throwing an exception or
Request interface
779

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents