Calling on all you CF-Java-knowledgeable folks out there. I'm trying
to follow some of the examples in the iText tutorial, and I've hit a
mental wall.
When trying to instance a file output stream, the java example I see
looks like this:
Document document = new Document();
try {
While I don't know a lot about using java objects in CF, I know more
about java itself. A static method is called on the class itself, not
the object that gets instantiated. This is useful for tracking the
number of times an object gets instantiated and obviously for other
reasons as well.
With iText you have to do a bunch of stupid things to each object before you
use it and leaving it blank or the defaults will cause
errors. It's a big pain to debug. Just keep saying fill all the buckets or
the bucket with break, over and over like a nut while you code iText.
Here is some code to
You don't need to call init() before calling the static method. For example:
cfset sysObj = createObject(java, java.lang.System) /
cfoutput#sysObj.currentTimeMillis()#/cfoutput
System.currentTimeMillis() is a static method...
-dante
Kris,
When accessing a static method, all you need to do is do the
createObject() call - this gives you access to the class (per se), if
you want an actual instance of the object, that would be when you call
init().
So in your case it would be:
fso =
website at http://www.reedexpo.com
-Original Message-
From: Dan Plesse
To: CF-Talk
Sent: Wed Aug 30 00:06:17 2006
Subject: Re: calling Java static method
With iText you have to do a bunch of stupid things to each object before you
use it and leaving it blank or the defaults will cause
errors
-Talk
Sent: Wed Aug 30 00:06:17 2006
Subject: Re: calling Java static method
With iText you have to do a bunch of stupid things to each object before
you
use it and leaving it blank or the defaults will cause
errors. It's a big pain to debug. Just keep saying fill all the buckets
or
the bucket
Dear Rob the miss reader,
You miss read as per normal. You have to click on the .txt to understand.
I was talking about TTS
~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion
Mark, I had thought this would be the answer but I was getting a
NullPointerException. There must be some other issue with my code. The
CF way of referencing the Java libs is new to me, so it helps to have
more experienced minds verifying my assumptions. Thanks so much.
And Dan, I grabbed a bit
Kris,
Don't know if this helps, but here is some code I had working for me:
document = createObject(Java, com.lowagie.text.Document).init();
os = createObject(java, java.io.ByteArrayOutputStream).init();
writer = createObject(Java,
10 matches
Mail list logo