O'Reilly logo

Programming ColdFusion MX, 2nd Edition by Rob Brooks-Bilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Custom Controls

The cfapplet tag allows you to use custom Java controls within your ColdFusion pages as if they were native ColdFusion tags, like cftree and cfgrid. Although it isn’t required that you use cfapplet within a cfform block, this is generally where the tag is used the most. For example, you might have a Java applet called Menu that acts as an expandable/collapsible menu you’d like to use in a ColdFusion application. In order to call a custom Java applet, it first has to be registered with the ColdFusion Administrator (Figure 10-15).

The applets section of the ColdFusion Administrator

Figure 10-15. The applets section of the ColdFusion Administrator

To register a custom Java applet, you need to complete the following steps:

  1. Open the ColdFusion Administrator, and click on the Java Applets link.

  2. Click the Register New Applet button.

  3. Enter information into the applet registration page, which is shown in Figure 10-16. When you are finished filling in the form, click the Submit Changes button to save your selection.

The applet registration page of the ColdFusion Administrator

Figure 10-16. The applet registration page of the ColdFusion Administrator

The following list explains each option on the registration page:

Applet Name

Enter a name for your Java control.

Code

Enter the name of your Java .class file. You don’t need to list the .class extension. (e.g., myapplet).

Codebase

Enter the base URL ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required