Setting up your development environment to develop CFX tags in Java
You can use a wide range of Java development environments, including the Java Development Kit
(JDK) version 1.3.1 from Sun, to build Java CFX tags. You can download the JDK from Sun
http://java.sun.com/j2se.
Macromedia recommends that you use one of the commercial Java IDEs, such as Dreamweaver
MX, that provide an integrated environment for development, debugging, project management,
and access to documentation.
Configuring the classpath
To configure your development environment to build Java CFX tags, you must ensure that the
supporting classes are visible to your Java compiler. These classes are located in the cfx.jar archive,
located in the lib subdirectory of your ColdFusion installation directory. Consult your Java
development tool documentation to determine how to configure the compiler classpath for your
particular environment.
The lib directory created by the ColdFusion setup program serves two purposes:
•
It contains the supporting classes required for developing and deploying Java CFX tags. This is
the com.allaire.cfx package located in the cfx.jar archive.
•
It supports a feature that reloads Java CFX tags located in the directory every time they are
changed. Although this is not the default behavior for other Java classes, this behavior is very
useful during an iterative development and testing cycle.
When you create new Java CFX tags, you should develop them in the web_root/WEB-INF/classes
directory. Doing this simplifies your development, debugging, and testing processes.
After you finish with development and testing, you can deploy your Java CFX tag anywhere on
the classpath visible to the ColdFusion embedded JVM. For more details on customizing the
classpath, see
"Customizing and configuring
Customizing and configuring Java
Use the JVM and Java Settings page on the ColdFusion MX Administrator Server tab to
customize your Java development environment, such as by customizing the classpath and Java
system properties, or specifying an alternate JVM. For more information, see the ColdFusion MX
Administrator online Help.
Writing a Java CFX tag
To create a Java CFX tag, create a class that implements the
interface contains one method,
that are then used to do the work of the tag.
The example in the following procedure creates a very simple Java CFX tag named
cfx_MyHelloColdFusion
Java".
processRequest
that writes a text string back to the calling page.
CustomTag interface
, which is passed
Request
Writing a Java CFX tag
. This
and
objects
Response
253
Need help?
Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?
Questions and answers