Adobe COLDFUSION 9 Manual page 235

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Building Blocks of ColdFusion Applications
ZipInputStream zin = new ZipInputStream( new FileInputStream(strArchive) ) ;
ZipEntry entry ;
while ( ( entry = zin.getNextEntry()) != null ) {
// Add a row to the results.
int iRow = files.addRow() ;
// populate the row with data
files.setData( iRow, iName, entry.getName() ) ;
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 run from an existing process. As a result, debugging Java CFX tags is more difficult, because you cannot
use an interactive debugger to debug Java classes that another process has loaded.
To overcome this limitation, you can use one of the following techniques:
• Debug the CFX tag while it is running within ColdFusion 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 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 must debug a Java CFX tag while running against a live production server, reset this technique. In addition to
outputting debugging text using the
attribute. This attribute flags the CFX tag that the request is running in debug mode and therefore can
debug="On"
generate additional extended debugging information. For example, to call the
debugging mode, use the following CFML code:
<cfx_HelloColdFusion name="Robert" debug="On">
To determine whether a CFX tag is run with the
output in a special debugging block after the tag finishes executing, use the
information on using these methods, see ColdFusion Java CFX Reference in CFML Reference.
method, you can also call your Java CFX tag with the
Response.write
attribute, use the
debug
Last updated 8/5/2010
CFX tag in
HelloColdFusion
method. To write debugging
Request.debug
Response.writeDebug
230
method. For

Advertisement

Table of Contents
loading

Table of Contents