Lucee Function Reference

Function CREATEOBJECT

The CreateObject function takes different arguments depending on the value of the first argument:
CreateObject('com', class, context, serverName)
CreateObject('component', component-name)
CreateObject('java', class, ...)
CreateObject('webservice', urltowsdl, [, portname])

Example

createobject(string type,[string classname,[object context,[object delimiterOrVersion]]]):any

Arguments

The arguments for this function are set. You can not use other arguments except the following ones.
Name Type Required Description
type string  Yes one of the following:
  • java: for loading a java object
  • webservice: for loading a remote webservice
  • component: for loading a Component (this functions does not call the init method of the component)
  • com: for loading a com Object  
  • classname string  No the usage of this argument depend on type defined with argument "type":
  • java: java class to load
  • webservice: WSDL url to call
  • component: The CFC name; corresponds to the name of the file that defines the component
  • com: Component ProgID for the object to invoke.  
  • context object  No the usage of this argument depend on type defined with argument "type":
  • com: not used (ignored)
  • java: "classpath" or "bundleName" used to load the defined class,
    this can be a list of multiple paths (directories containing class files or jar files) as string list or array or a name of an OSGi bundle (Lucee can download OSGi bundles automatically if necessary)
  • webservice: a struct containing the following optional keys (username,password,proxyServer,proxyPort,proxyUser,proxyPassword)
  • component: not used (ignored)  
  • delimiterOrVersion object  No the usage of this argument depend on type defined with argument "type":
  • java: delimiter used for the classpath (default comma) or bundle version when the previous argument was a bundle name
  • webservice: not used (ignored)
  • component: not used (ignored)
  • com: not used (ignored)