In the 2018 release of ColdFusion, there is a handy way to create objects in ColdFusion.
The snippet below illustrates how you can use the new operator to create different type of objects.
//ColdFusion Component
obj = new component(“path.to.cfc”)
obj.init()
// Java
obj = new java(“java.class”)
obj.init()
// WebService
obj = new webservice(“http://webservice?wsdl”, {“webservice”: “parameters”})
Similarly, you can use the new operator to create com, CORBA, and .NET objects as well.
Where is the new java() function documented? I can see that passing _multiple arguments_ is doing _something_. However, I cannot find the documentation to see what it is. For example, if I do this:
“`
new java( “org.jsoup.Jsoup”, “jsoup-1.14.3.jar” );
“`
I get the error:
“Jar not found in repository : /jsoup-1.14.3.jar:null”
… so clearly, the java() constructor takes more than one argument (since why else would the 2nd arg show up in the error message). But, I don’t know what signature it is looking for. Can you please point me to the documentation? Google is failing me.
You must be logged in to post a comment.