Calling the CFX tag from a ColdFusion page
You call Java CFX tags from within ColdFusion pages by using the name of the CFX tag that is registered on the ColdFusion MX Administrator CFX tags page. This name should be the prefix cfx_
followed by the class name (without the .class extension).
To register a Java CFX tag in the ColdFusion MX Administrator:
-
In the ColdFusion MX Administrator, select Extensions > CFX Tags to open the CFX Tags page.
-
Click Register Java CFX.
-
Enter the tag name (for example,
cfx_MyHelloColdFusion
).
-
Enter the class name without the .class extension (for example,
MyHelloColdFusion
).
-
(Optional) Enter a description.
-
Click Submit.
You can now call the tag from a ColdFusion page.
To call a CFX tag from a ColdFusion page:
-
Create a ColdFusion page (.cfm) in your editor with the following content to call the HelloColdFusion custom tag:
<html>
<body>
<cfx_MyHelloColdFusion NAME="Les">
</body>
</html>
-
Save the file in a directory configured to serve ColdFusion pages. For example, you can save the file as C:\inetpub\wwwroot\cfdocs\testjavacfx.cfm on Windows or /home/docroot/cfdocs/testjavacfx.cfm on UNIX.
-
If you have not already done so, register the CFX tag in the ColdFusion MX Administrator (see Registering CFX tags).
-
Request the page from your browser using the appropriate URL; for example:
http://localhost/cfdocs/testjavacfx.cfm
ColdFusion processes the page and returns a page that displays the text "Hello, Les." If an error is returned instead, check the source code to make sure you have entered it correctly.
To delete a CFX tag in the ColdFusion MX Administrator:
-
In the ColdFusion MX Administrator, select Extensions > CFX Tags to open the CFX Tags page.
-
For the tag you want to delete, click the Delete icon in the Controls column of the Registered CFX Tags list.
View comments in LiveDocs