| Contents > CFML Reference > ColdFusion Functions > CreateObject: Java or EJB object |
|
|
|
|
||
The CreateObject function can create a Java object, and, by extension, an EJB object.
A Java object.
CreateObject(type, class)
Parameter |
Description |
|---|---|
type |
Type of object to create.
|
class |
A Java class name |
Any Java class available in the class path that is specified in the ColdFusion Administrator can be loaded and used from ColdFusion with the CreateObject function.
To access Java methods and fields:
CreateObject function or the cfobject tag to load the class. init method, with appropriate arguments, to call an instance of the class. For example:<cfset ret = myObj.init(arg1, arg2)>
Calling a public method on the object without first calling the "init" method invokes a static method. Arguments and return values can be any Java type (simple, array, object). If strings are passed as arguments, ColdFusion does the conversions; if strings are received as return values, ColdFusion does no conversion.
Overloaded methods are supported if the number of arguments is different. Future enhancements will let you use cast functions that allow method signatures to be built more accurately.
|
|
||
| Contents > CFML Reference > ColdFusion Functions > CreateObject: Java or EJB object |
|
|
ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting
Version 6.1
Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi47.htm