About ColdFusion and Java objects

Java objects include the following:

ColdFusion pages use the cfobject tag to access Java objects.

ColdFusion MX searches for the objects in the following order:

  1. The ColdFusion Java Dynamic Class Load directories:
  2. The classpath specified on the JVM and Java Settings page in the ColdFusion MX Administrator.
  3. The default JVM classpath.

About class loading

ColdFusion dynamically loads classes that are either .class files in the web_root/WEB-INF/classes directory or in JAR files in the web_root/WEB-INF/lib directory. ColdFusion checks the time stamp on the file when it creates an object that is defined in either directory, even when the class is already in memory. If the file that contains the class is newer than the class in memory, ColdFusion loads the class from that directory.

To use this feature, make sure that the Java implementation classes that you modify are not in the general JVM classpath.

To disable automatic class loading of your classes, put the classes in the JVM classpath. Classes located on the JVM classpath are loaded once per server lifetime. To reload these classes, stop and restart ColdFusion MX.

Note: Because you put tag libraries in the web_root/WEB-INF/lib directory, ColdFusion automatically reloads these libraries if necessary when you import the library.

About GetPageContext and the PageContext object

Because ColdFusion pages are J2EE servlet pages, all ColdFusion pages have an underlying Java PageContext object. CFML includes the GetPageContext function that you can then use in your ColdFusion page.

The PageContext object exposes a number of fields and methods that can be useful in J2EE integration. In particular, it includes the include and forward methods that provide the equivalent of the corresponding standard JSP tags.

This chapter describes how to use the include and forward PageContext methods for calling JSP pages and servlets. It does not discuss the PageContext object in general. For more information on the object, see Java documentation. You can find the Javadoc description of this class at http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/PageContext.html.


View comments in LiveDocs