Yes you can invoke a cfc from a servlet using the following syntax. Note that 
request is the servlet request object, response is the servlet response object, 
and out is a java.io.Writer where the output from the cfc is written. The 
invoke() method returns an object so you'll need to cast it to the type 
returned by the cfc. In the case below the cfc is returning a java.util.Map 
object.

com.newatlanta.cfc.CFCProxy myCFC = new com.newatlanta.cfc.CFCProxy("javacall", 
request, response, out);
Object[] myArgs = {"Java invocation working"};
java.util.Map map = (java.util.Map)myCFC.invoke("getData", myArgs);

If the cfc doesn't generate any output then you don't need to pass a 
java.io.Writer as shown below:

com.newatlanta.cfc.CFCProxy myCFC = new com.newatlanta.cfc.CFCProxy("javacall", 
request, response);
Object[] myArgs = {"Java invocation working"};
java.util.Map map = (java.util.Map)myCFC.invoke("getData", myArgs);

Paul

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of 
BD_Architect
Sent: Thursday, November 12, 2009 10:45 PM
To: Open BlueDragon
Subject: [OpenBD] Execute CFC from Java


Is there a simple way to invoke a cfc from a java file?  I see that
there is a CFCProxy for adobe, is this (or similar) also available in
openBD.


--~--~---------~--~----~------------~-------~--~----~
Open BlueDragon Public Mailing List
 http://groups.google.com/group/openbd?hl=en
 official site @ http://www.openbluedragon.org/

!! save a network - trim replies before posting !!
-~----------~----~----~----~------~----~------~--~---

Reply via email to