Before you begin developing CFX tags in Java, configure your Java development environment. Also, it can be helpful to review the examples here before you create CFX tags.

Sample Java CFX tags

Before you begin developing a CFX tag in Java, it can be useful to study sample CFX tags. You can find the Java source files for the examples for Windows in the cfx\java\distrib\examples subdirectory of the main installation directory. In UNIX systems, the files are located in the cfx/java/examples directory. The following table describes the example tags:

Example

Action

Demonstrates

HelloColdFusion

Prints a personalized greeting.

The minimal implementation required to create a CFX tag.

ZipBrowser

Retrieves the contents of a ZIP archive.

How to generate a ColdFusion query and return it to the calling page.

ServerDateTime

Retrieves the date and time from a network server.

Attribute validation, using numeric attributes, and setting variables within the calling page.

OutputQuery

Returns a ColdFusion query in an HTML table.

How to handle a ColdFusion query as input, throw exceptions, and generate dynamic output.

HelloWorldGraphic

Generates a "Hello World!" graphic in JPEG format.

How to dynamically create and return graphics from a Java CFX tag.

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) from Sun, to build Java CFX tags. You can download the JDK from Sun http://java.sun.com/j2se.
Adobe recommends that you use one of the commercial Java IDEs, so you have an integrated environment for development, debugging, and project management.

Configuring the classpath

To configure your development environment to build Java CFX tags, ensure that the supporting classes are visible to your Java compiler. These classes are located in the cfx.jar archive, located in one of the following directories:

  • Server configuration cf_root/wwwroot/WEB-INF/lib
  • J2EE configuration cf_webapp_root/WEB-INF/libConsult your Java development tool documentation to determine how to configure the compiler classpath for your particular environment. The cfx.jar archive contains the classes in the com.allaire.cfx package, which are required for developing and deploying Java CFX tags.When you create new Java CFX tags, compile them into the WEB-INF/classes directory. Doing so 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 ColdFusion.

Customizing and configuring Java

Use the ColdFusion Administrator > Server Settings > JVM and Java Settings page to customize your Java development environment by customizing the classpath and Java system properties, or by specifying an alternate JVM. For more information, see the ColdFusion Administrator online Help.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy