Provides support for writing Java code within ColdFusion.
<cfjava handle="classInstance">
cfjava(handle="classInstance");
<cfjava handle="nameInstance">
public class Name {
private String firstName;
private String lastName;
public Name(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
public String getFullName() {
return firstName + " " + lastName;
}
}
</cfjava>
<cfset nameInstance.init("John", "Doe")>
<cfset fullName = nameInstance.getFullName()>
<cfoutput>#fullName#</cfoutput>
Expected Result: John Doe
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.