Make sure the you have a Class Path setup for the package you are trying to
use in ColdFusion Administrator (located under Java).
<cfscript>
mailerObj = CreateObject("Java","mailer.mainMailer");
</cfscript>
If the class constructor takes arguments, simple call the init() function
and pass the args in the appropriate order.
<cfscript>
mailerObj = CreateObject("Java","mailer.mainMailer");
mailerObj.init("arg1","arg2","#arg3#",...);
</cfscript>
HTH #_#
--
Scott Van Vliet
Sempra Energy
555 W. 5th St., 21st Floor
Los Angeles, CA 90013
Tel > 213.244.5205
Email > [EMAIL PROTECTED]
> -----Original Message-----
> From: Florin Chitu [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 13, 2002 8:01 AM
> To: CF-Talk
> Subject: load java class from a package
>
>
> Hi,
> which is the way one can load a java class from a package in
> a .cfm file ?
> (for a single class, that is not in a package the operation is quite
> streight forward, but when I trry to load a class from a
> package a get a
> "class not found error message)
>
> package : mailer
> it has three classes : mainMailer.class, saxMailer.class,
> smtpMailer.class
>
> I need to load the mainMailer.class (from the mailer package)
> and create an
> object.
> Thank you,
> Florin
>
> FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
> Archives: http://www.mail-archive.com/[email protected]/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
>
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists