User Guide

Table Of Contents
168 Chapter 8: Creating ColdFusion Elements
Dynamically generate HTML to be returned to the client.
Set variables within the ColdFusion page from which they are called.
Throw exceptions that result in standard ColdFusion error messages.
Calling CFX tags
To use a CFX tag, precede the class name with cfx_ and put the name in angle brackets. For
example, use the following line to call the CFX tag defined by the MyCFXClass class and pass it
one attribute.
<cfx_MyCFXClass myArgument="arg1">
Recommended uses
CFX tags provide one way of using C++ or Java code. However, you can also create Java classes
and COM objects and access them using the
cfobject tag. CFX tags, however, provide some
built-in features that the
cfobject tag does not have:
CFX tags are easier to call in CFML code. You use CFX tags directly in CFML code as you
would any other tag, and you can pass arguments using a standard tag format.
ColdFusion provides predefined classes for use in your Java or C++ code that facilitate CFX tag
development. These classes include support for request handling, error reporting, and query
management.
You should consider using CFX tags in the following circumstances:
You already have existing application functionality written in C++ or Java that you want to
incorporate into your ColdFusion application.
You cannot build the functionality you need using ColdFusion elements.
You want to provide the new functionality in a tag format, as opposed to using the cfobject
tag to import native Java or COM objects.
You want use the Java and C++ classes provided by ColdFusion for developing your CFX code.
For more information
For more information on CFX tags, see Chapter 12, “Building Custom CFXAPI Tags,” on
page 259.