Actually, .init(javaCast("int", 2));
Regards Dale Fraser > -----Original Message----- > From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On > Behalf Of Mark Mandel > Sent: Tuesday, 21 March 2006 15:50 PM > To: cfaussie@googlegroups.com > Subject: [cfaussie] Re: Call Java Class (Java Code Attached) > > You will need to do - > > createObject("java", "IceKey").init(javaCast(1, "init")); > > Which will insure the parameter passed to the constructor is an actual int, > not a Integer object. > > > > I tried, just 1 it said didn't like strings, tried int(1) said it > didn't > like doubles, damm I hate this, wasn't CF / Java talking supposed to > be > easy? > > > > > I'm sorry, but this really upsets me Dale. Integeration with Java IS easy > if you understand both Java and ColdFusion. > > Walking up to Java blind and asking it to play nicely with ColdFusion > without even a basic understanding of Java concepts and then wondering why > it won't work seems to me to be a bit rediculous, don't you think? > > It seems to me that you are trying to run here, without first learning how > to walk - you obviously have very minimal knowledge of Java as a whole. I > would highly suggest doing some training and/or reading about Java and OO > concepts before continuing down this path. You will find it far easier in > the long run. > > Regards, > > Mark > > > On 3/21/06, Dale Fraser <[EMAIL PROTECTED]> wrote: > > > > For future reference, a Java class's constructor method has the > same name > > as the class. If you think the constructor (init) might require > arguments, > > you can look through the source code for that method. > > I was aware of this, but didn't see that method, used to it being at > the top > I guess. > > Anyway, still can't get it working. > > Unable to find a constructor for class IceKey that accepts > parameters of > type ( java.lang.Integer ). > > > The error occurred in D:\Tools\Web\test.cfm: line 2 > > 1 : <cfobject action="create" type="java" class="IceKey" > name="myObj" /> > 2 : <cfset ret = myObj.init(asc("")) /> > 3 : <cfdump var="#myObj#" /> > > > I tried, just 1 it said didn't like strings, tried int(1) said it > didn't > like doubles, damm I hate this, wasn't CF / Java talking supposed to > be > easy? > > Regards > Dale Fraser > > > > > > -- > E: [EMAIL PROTECTED] > W: www.compoundtheory.com > ICQ: 3094740 > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie -~----------~----~----~----~------~----~------~--~---