Java

Functions

  • BundleInfo() if the given object is loaded by an OSGi bundle, this function is returning information about that bundle
  • CreateDynamicProxy() Wraps the given component with a Java class that implements the specified interfaces. If no interfaces are provided, Lucee will create a proxy based on the component's interface itself.
  • CreateObject() The CreateObject function takes different arguments depending on the value of the first argument:
  • GetClassPath() returns an array containing the Java classpath of the current environment.
  • GetPageContext() Gets the current PageContext object that provides access to page attributes and configuration, request and response objects.
  • JavaCast() Converts the data type of a CFML variable to pass as an argument to an overloaded method of a Java object. Use only for scalar and string arguments. [type - quickly] boolean,int,long,float,double,string
  • ManifestRead() reads a manifest file and returns the content as struct
  • MavenLoad() Loads all JAR files from one or more Maven endpoints and makes them available for use within the Lucee server environment. This function can be used to load dependencies, including transitive ones, for example at server startup. ### Example Usage of MavenLoad Function The `MavenLoad` function allows you to load JAR files from Maven repositories, including all transitive dependencies
  • Serialize() opposite of evaluate, this function serialize all cfml object and all serializable Java objects. can also serialize Components.
  • UnserializeJava() literal definition of a serialized Java Object by function serialize

Tags

  • <cfimport> The tag `import` has a dual purpose, it can be used to import components with help of the attribute `path` or CFML/JSP custom tags with help of the attributes `prefix` and `taglib`.
  • <cfobject> Lets you call methods in COM, CORBA, and JAVA objects.

Guides

  • Lucee 5 and OSGi Lucee 5 is completely based around OSGi
  • Lucee with Maven You can add Lucee to your Maven pom.xml files via the following: And the dependency via: ```lucee org.lucee lucee 5.3.8.206 ``` Or the single Lucee jar artifactId is &quot;lucee-jar&quot;. (The above has all the dependencies, with the exception of database drivers which are marked as &quot;optional&quot;, thus not included by default
  • Using Java in Lucee ### Do you really need Java? ### Before you start creating Java objects in Lucee you should ask yourself: Do I really need Java here or can I get the same result with CFML alone? It's been said in computing that &quot;premature optimization is the root of all evil&quot; and Sean will (rightfully) remind you that &quot;perfection is the enemy of the good&quot;, so if you can achieve similar results without referring to Java objects -- please stick to CFML path