User Guide
394 Chapter 21 Building Custom CFXAPI Tags
This section provides an overview of these object types. For a complete example Java
CFX that uses
Request, Response, and Query objects, see the “ZipBrowser Example”
on page 397.
Request object
The Request object is passed to the processRequest method of the CustomTag
interface. It provides methods for retrieving attributes, including queries, passed to
the tag and for reading global tag settings.
Response object
The Response object is passed to the processRequest method of the CustomTag
interface. It provides methods for writing output, generating queries, and setting
variables within the calling page.
Query object
The Query object provides an interface for working with ColdFusion queries. It
includes methods for retrieving name, row count, and column names and methods
for getting and setting data elements.
Method Description
attributeExists Checks whether the attribute was passed to this tag.
getAttribute Retrieves the value of the passed attribute.
getIntAttribute Retrieves the value of the passed attribute as an integer.
getAttributeList Retrieves a list of all attributes passed to the tag.
getQuery Retrieves the query that was passed to this tag, if any.
getSetting Retrieves the value of a global custom tag setting.
debug Checks whether the tag contains the
debug attribute.
Method Description
write
Outputs text into the calling page.
setVariable
Sets a variable in the calling page.
addQuery
Adds a query to the calling page.
writeDebug
Outputs text into the debug stream.
Method Description
getName
Retrieves the name of the query.
getRowCount
Retrieves the number of rows in the query.
getColumns
Retrieves the names of the query columns.
getData
Retrieves a data element from the query.