a beginners guide to java integration in coldfusion
Download
Skip this Video
Download Presentation
A Beginners Guide to Java Integration in ColdFusion

Loading in 2 Seconds...

play fullscreen
1 / 19

a beginners guide to java integration in coldfusion - PowerPoint PPT Presentation


  • 209 Views
  • Uploaded on

A Beginners Guide to Java Integration in ColdFusion. Rick Root. Who Am I?. It just doesn’t seem right to have a slide with bullet points that prompt me to talk about myself. About This Session. Extend ColdFusion with “core” java Extend ColdFusion with external java libraries

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'a beginners guide to java integration in coldfusion' - johana


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
who am i
Who Am I?
  • It just doesn’t seem right to have a slide with bullet points that prompt me to talk about myself.
about this session
About This Session
  • 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.
who are you
Who Are You?
  • ColdFusion newbs
  • Never really used Java in ColdFusion
  • Just here for the networking
using core java functionality
Using Core Java Functionality
  • Java Objects
  • Data Types
  • Creating and Initializing Java Objects
  • JavaCast()
  • Examples
java objects
Java Objects
  • It all starts with java.langObject
  • Java objects have methods, so ColdFusion variables do to.
  • Example 1
data types java vs cf
Data Types – Java vs. CF
  • Strictly typed, very picky!
  • Don’t assume!
  • Example 2
creating and initializing java objects
Creating and Initializing Java Objects
  • In Java, create and initialize all at once, ie:foo = new ClassName(arguments)
  • In CF, use CreateObject() and init() methodfoo = CreateObject(“java”,”path.to.ClassName”); foo.init(arguments);
  • Multiple constructors / overloaded methods foo.init(“string”);foo.init(someint);
javacast
JavaCast()
  • Force a ColdFusion variable to be a specific data type
  • Example 3 & 4
string concatenation example
String Concatenation Example
  • Object creation is expensive
  • Strings are immutable
  • Java StringBuffer object can help!
  • Example 5
using third party libraries
Using Third Party Libraries
  • Where to Install
  • Java Loader
  • Examples
installing third party libraries
Installing Third Party Libraries
  • Standalone: <cfroot>/lib
  • Multi-server Install, all instances: <jrunroot>/servers/lib
  • Multi-server install, specific Instance: <jrunroot>/servers/<instancename> /cfusion.ear/cfusion.war /WEB-INF/cfusion/lib
  • Anywhere you want!
using javaloader
Using JavaLoader
  • javaloader.cfc – Mark Mandel
  • Access classes without requiring them to be in the server CLASSPATH
  • Javaloader.riaforge.org
  • Example 6
examples
Examples
  • Generating Excel Files
  • Creating delimited text files
  • Extracting JPEG image metadata
generating excel files
Generating Excel Files
  • Apache POI – API to interface with Microsoft Office files
  • http://poi.apache.org
  • Create Excel files in native format
  • Use more Excel features
  • Example 7
creating delimited files
Creating Delimited Files
  • JavaCSV makes it easy
  • Choose your delimiter
  • Automatic quoting when data contains your delimiter or even newlines
  • Example 8
extracting jpeg image metadata
Extracting JPEG Image Metadata
  • Digital cameras store lots of metadata in captured images
  • Timestamp
  • Exposure
  • Camera model
  • Lots of stuff I don’t understand!
  • Example 9
wrap up
Wrap Up
ad