User Guide

Table Of Contents
266 Chapter 12: Building Custom CFXAPI Tags
files.setData( iRow, iSize,
String.valueOf(entry.getSize()) ) ;
files.setData( iRow, iCompressed,
String.valueOf(entry.getCompressedSize()) ) ;
// finish up with entry
zin.closeEntry() ;
}
// close the archive
zin.close() ;
}
}
Approaches to debugging Java CFX tags
Java CFX tags are not stand-alone applications that run in their own process, like typical Java
applications. Rather, they are created and invoked from an existing process. This makes
debugging Java CFX tags more difficult, because you cannot use an interactive debugger to debug
Java classes that have been loaded by another process.
To overcome this limitation, you can use one of the following techniques:
Debug the CFX tag while it is running within ColdFusion MX by outputting the debug
information as needed.
Debug the CFX tag using a Java IDE (Integrated Development Environment) that supports
debugging features, such as setting breakpoints, stepping through your code, and displaying
variable values.
Debug the request in an interactive debugger offline from ColdFusion MX using the special
com.allaire.cfx debugging classes.
Outputting debugging information
Before using interactive debuggers became the norm, programmers typically debugged their
programs by inserting output statements in their programs to indicate information such as
variable values and control paths taken. Often, when a new platform emerges, this technique
comes back into vogue while programmers wait for more sophisticated debugging technology to
develop for the platform.
If you need to debug a Java CFX tag while running against a live production server, this is the
technique you must use. In addition to outputting debugging text using the
Response.write
method, you can also call your Java CFX tag with the
debug="On" attribute. This attribute flags
the CFX tag that the request is running in debug mode and therefore should output additional
extended debugging information. For example, to call the
HelloColdFusion CFX tag in
debugging mode, use the following CFML code:
<cfx_HelloColdFusion name="Robert" debug="On">