Presentation on theme: "Rick Root. It just doesn’t seem right to have a slide with bullet points that prompt me to talk about myself."— Presentation transcript:
It just doesn’t seem right to have a slide with bullet points that prompt me to talk about myself.
Extend ColdFusion with “core” java Extend ColdFusion with external java libraries We will not talk about JVM tuning, writing CFX Custom Tags in Java, or writing your own Java classes.
ColdFusion newbs Never really used Java in ColdFusion Just here for the networking
Java Objects Data Types Creating and Initializing Java Objects JavaCast() Examples
It all starts with java.langObjectjava.langObject Java objects have methods, so ColdFusion variables do to. Example 1
Strictly typed, very picky! Don’t assume! Example 2
In Java, create and initialize all at once, ie: foo = new ClassName(arguments) In CF, use CreateObject() and init() method foo = CreateObject(“java”,”path.to.ClassName”); foo.init(arguments); Multiple constructors / overloaded methods foo.init(“string”); foo.init(someint);
Force a ColdFusion variable to be a specific data type Example 3 & 4
Object creation is expensive Strings are immutable Java StringBuffer object can help! Example 5
Where to Install Java Loader Examples
Standalone: /lib Multi-server Install, all instances: /servers/lib Multi-server install, specific Instance: /servers/ /cfusion.ear/cfusion.war /WEB-INF/cfusion/lib Anywhere you want!
javaloader.cfc – Mark Mandel Access classes without requiring them to be in the server CLASSPATH Javaloader.riaforge.org Javaloader.riaforge.org Example 6