Using The Debugging Classes - MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual

Developing coldfusion mx applications
Table of Contents

Advertisement

Debug your application by setting breakpoints, single stepping, displaying variables, or by
5
performing other debugging actions.

Using the debugging classes

To develop and debug Java CFX tags in isolation from the ColdFusion, you use three special
debugging classes that are included in the
simulate a call to the
interactive debugger of a Java development environment. The three debugging classes are:
DebugRequest
request with custom attributes, settings, and a query.
DebugResponse
of a request once it has completed.
DebugQuery
name, columns, and a data set.
To use the debugging classes:
Create a
1
main
Within the
2
main
Use the appropriate attributes and data for your test.
Create an instance of your Java CFX tag and call its
3
DebugRequest
Call the
4
DebugResponse.printResults
content generated, variables set, queries created, and so on.
After you implement a
using an interactive, single-step debugger. Specify your Java CFX class as the
breakpoints as appropriate, and begin debugging.
Debugging classes example
The following example demonstrates how to use the debugging classes:
import java.util.Hashtable ;
import com.allaire.cfx.* ;
public class OutputQuery implements CustomTag {
// debugger testbed for OutputQuery
public static void main(String[] argv) {
try {
// initialize attributes
Hashtable attributes = new Hashtable() ;
attributes.put( "HEADER", "Yes" ) ;
attributes.put( "BORDER", "3" ) ;
// initialize query
String[] columns =
{ "FIRSTNAME", "LASTNAME", "TITLE" } ;
String[][] data =
{ "Stephen", "Cheng", "Vice President" },
{ "Joe", "Berrey", "Intern" },
{ "Adam", "Lipinski", "Director" },
260
Chapter 12: Building Custom CFXAPI Tags
processRequest
An implementation of the
An implementation of the
An implementation of the
method for your Java CFX class.
method, initialize a
and
DebugResponse
method as described previously, you can debug your Java CFX tag
main
{
com.allaire.cfx
method of your CFX tag within the context of the
interface that lets you initialize the
Request
interface that lets you print the results
Response
interface that lets you initialize a query with a
Query
and
DebugRequest
DebugResponse
processRequest
objects.
method to output the results of the request, including
package. These classes lets you
, and a
method, passing in the
class, set
main
.
DebugQuery

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents