User Guide

Chapter 18: Building Custom CFAPI Tags 319
Throws:
NumberFormatException — If the attribute is not a valid number.
See Also:
attributeExists, getAttributeList, getIntAttribute(String,int)
getAttributeList
public String[] getAttributeList()
Retrieves a list of all attributes passed to the tag. To retrieve the value of an
individual attribute you should use the getAttribute member function.
The following example retrieves the list of attributes and 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>" ) ;
}
Returns:
An array of strings containing the names of the attributes passed to the tag.
See Also:
attributeExists, getAttribute
getQuery
public Query getQuery()
Retrieves the query that was passed to this tag.
To pass a query to a custom tag you use the QUERY attribute. This attribute should
be set to the name of an existing query (e.g. created using the CFQUERY tag). The
QUERY attribute is optional and should only be used by tags which need to
process an existing dataset.
The following example retrieves the query which was passed to the tag. If no query
was passed then an exception is thrown:
Query query = request.getQuery() ;
if ( query == null )
{
throw new Exception(
"Missing QUERY parameter. " +
"You must pass a QUERY parameter in "