Download Extending ColdFusion with CFX
Transcript
8 CHAPTER 30 Table 30.9 Extending ColdFusion with CFX (continued) METHOD DESCRIPTION request.debug() Determines whether the tag has been called with the debug attribute turned on. If so, you would presumably include some kind of debugging message in the current Web page with writeDebug(). For details, see the “Generating Debug Output” section later in this chapter. response.writeDebug(text) Includes a text message in the current Web page. Very similar to response.write(), except that the text is only included in the page if the tag has been called with a debug attribute. Table 30.10 C++ Methods for Exceptions and Debugging METHOD DESCRIPTION pRequest->ThrowException (message, detail) Creates an exception (error message), similar to the <cfthrow> tag in CFML. The message and detail must be specified as LPCSTR compatible values. pRequest->Debug() Determines whether the tag has been called with the debug attribute turned on. If so, you would presumably include some kind of debugging message in the current Web page with WriteDebug(). pRequest->WriteDebug(text) Includes a text message in the current Web page. Very similar to pRequest->Write(), except that the text is only included in the page if the CFX is used with a debug attribute. Writing CFX Tags with Java Now that you’ve gotten an introduction to the methods available in the CFX API, you can get started creating CFX tags with Java or C++. Because I assume that more people will be writing tags in Java than C++ going forward, we’ll start off with Java. If you plan to work with C++, just take a quick look through this section, then skip ahead to the “Writing CFX Tags with Visual C++” section, later in this chapter. Getting Started The process of creating a Java CFX tag can be broken down into the following steps: 1. Writing the Java code in a text editor or Java IDE