MACROMEDIA COLDFUSION 5-DEVELOPING Develop Manual page 420

Table of Contents

Advertisement

400
Debugging classes example
The following example demonstrates the use of 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",
attributes.put( "BORDER", "3" ) ;
// initialize query
String[] columns =
{ "FIRSTNAME", "LASTNAME", "TITLE" } ;
String[][] data =
{ "Stephen", "Cheng", "Vice President" },
{ "Joe", "Berrey", "Intern" },
{ "Adam", "Lipinski", "Director" },
{ "Lynne", "Teague", "Developer" } }
DebugQuery query =
new DebugQuery( "Employees", columns, data ) ;
// create tag, process debug request, and print results
OutputQuery tag = new OutputQuery() ;
DebugRequest request = new DebugRequest( attributes, query ) ;
DebugResponse response = new DebugResponse() ;
tag.processRequest( request, response ) ;
response.printResults() ;
}
catch( Throwable e )
{
e.printStackTrace() ;
}
}
public void processRequest( Request request ) throws Exception
{
// ...code for processing the request...
}
Chapter 21 Building Custom CFXAPI Tags
"Yes" ) ;
{
;

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 5

Table of Contents