Tags · Functions · Objects
Lucee Function Reference
Choose a function:

Function CREATEOBJECT

this function is deprecated, do the following instead.
      - For Java use the function "JavaNew"
      - For Webservices use the function "WebserviceNew"
      - For Components do instead "new ComponentName()" or the function "loadComponent"
      - There is no replacement for "com"
      
      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:
  • com: for loading a com Object
  • 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)  
  • classname string  No the usage of this argument depend on type defined with argument "type":
  • com: Component ProgID for the object to invoke.
  • 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  
  • 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":
  • com: not used (ignored)
  • 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)