736
Chapter 33: Integrating J2EE and Java Elements in CFML Applications
About ColdFusion, Java, and J2EE
ColdFusion MX is built on a J2EE-compliant Java technology platform. This lets ColdFusion
applications take advantage of, and integrate with, J2EE elements. ColdFusion pages can do any
of the following:
•
Include JavaScript and client-side Java applets on the page.
•
Use JSP tags.
•
Interoperate with JSP pages.
•
Use Java servlets.
•
Use Java objects, including JavaBeans and Enterprise JavaBeans.
About ColdFusion and client-side JavaScript and applets
ColdFusion pages, like HTML pages, can incorporate client-side JavaScript and Java applets. To
use JavaScript, you write the JavaScript code just as you do on any HTML page. ColdFusion
ignores the JavaScript and sends it to the client.
The
cfapplet
tag simplifies using Java client-side applets.
To use an applet on a ColdFusion page:
1
Register the applet .class file in ColdFusion MX Administrator Java Applets Extensions page.
(For information on registering applets, see the ColdFusion MX Administrator online Help.)
2
Use the
cfapplet
tag to call the applet. The
appletSource
attribute must be the Applet name
assigned in ColdFusion MX Administrator.
For example, ColdFusion includes a Copytext sample applet that copies text from one text box to
another. The ColdFusion Setup automatically registers the applet in the Administrator. To use
this applet, incorporate it on your page. For example:
<cfform action = "copytext.cfm">
<cfapplet appletsource = "copytext" name = "copytext">
</cfform>
About ColdFusion and JSP
ColdFusion MX supports JSP tags and pages in the following ways:
•
Interoperates with JSP pages: ColdFusion pages can include or forward to JSP pages, JSP pages
can include or forward to ColdFusion pages, and both types of pages can share data in
persistent scopes.
•
Imports and uses JSP tag libraries: the
cfimport
tag imports JSP tag libraries and lets you use
its tags.
ColdFusion pages are not JSP pages, however, and you cannot use most JSP syntax on
ColdFusion pages. In particular you
cannot
use the following features on ColdFusion pages:
•
Include, Taglib, and Page directives
Instead, you use CFML
import
tag to import tag
libraries, and the
include
(or
forward
) method of the page context object returned by the
ColdFusion
GetPageContext
function to include pages. For more information, see
“Using
JSP tags and tag libraries” on page 739
and
“Interoperating with JSP pages and servlets”
on page 740
.
•
Expression, Declaration, and Scriptlet JSP scripting elements
Instead, you use CFML
elements and expressions.
Содержание ColdFusion MX
Страница 1: ...Developing ColdFusion MX Applications...
Страница 22: ...22 Contents...
Страница 38: ......
Страница 52: ...52 Chapter 2 Elements of CFML...
Страница 162: ......
Страница 218: ...218 Chapter 10 Writing and Calling User Defined Functions...
Страница 250: ...250 Chapter 11 Building and Using ColdFusion Components...
Страница 264: ...264 Chapter 12 Building Custom CFXAPI Tags...
Страница 266: ......
Страница 314: ...314 Chapter 14 Handling Errors...
Страница 344: ...344 Chapter 15 Using Persistent Data and Locking...
Страница 349: ...About user security 349...
Страница 357: ...Security scenarios 357...
Страница 370: ...370 Chapter 16 Securing Applications...
Страница 388: ...388 Chapter 17 Developing Globalized Applications...
Страница 408: ...408 Chapter 18 Debugging and Troubleshooting Applications...
Страница 410: ......
Страница 426: ...426 Chapter 19 Introduction to Databases and SQL...
Страница 476: ...476 Chapter 22 Using Query of Queries...
Страница 534: ...534 Chapter 24 Building a Search Interface...
Страница 556: ...556 Chapter 25 Using Verity Search Expressions...
Страница 558: ......
Страница 582: ...582 Chapter 26 Retrieving and Formatting Data...
Страница 668: ......
Страница 734: ...734 Chapter 32 Using Web Services...
Страница 760: ...760 Chapter 33 Integrating J2EE and Java Elements in CFML Applications...
Страница 786: ...786 Chapter 34 Integrating COM and CORBA Objects in CFML Applications...
Страница 788: ......
Страница 806: ...806 Chapter 35 Sending and Receiving E Mail...