Hello,
 
I wonder if I can use a ColdFusion instantiated object inside a jsp page.
In my cfm page I have:
<cfset request.myContent = CreateObject("component","navitacontent")>
Which has the available method "listUsergroups"
Then I include the jsp:
<cfset GetPageContext().include("test.jsp")>
 
Can I use the "listUsergroups" method In the test.jsp page (or better, inside a servlet or a Java class ?
 
Maybe I would have to create a Java class that can receive the ColdFusion objects, instantiate this
class from the cf and then pass the cf object to this class in order to use it.
 
 
Well, before you start asking why would someone want to do this stuff, the situation is:
We have developed our own Content management System, all done with CFCs, MVC, and using a DAO layer,
and now some clientes are asking for a jsp implementation.
 
We already done part of this, but using a webservices approach, we generated stubs for the cfcs WSDLs, and
concluded that the performance doesn't woth the risk.
 
We could re-write all the java classes, but all we want is to build our own tld, and maybe,
we could use the CF Objects inside our java code.
 
Any ideas about this architecture ? Is it viable ?
 
[]s
 
Marcantonio Silva
Diretor de Desenvolvimento de Produtos - Navita
[EMAIL PROTECTED]
www.navita.com.br
Tel: +55 11 3365.2173
Cel: +55 11 9656.4634

 

----- Original Message -----
Sent: Monday, May 10, 2004 11:57 AM
Subject: Re: [CFCDev] OT: Dynamic class instantiation in Java?

http://java.sun.com/docs/books/tutorial/reflect/object/noarg.html
http://java.sun.com/docs/books/tutorial/reflect/object/arg.html

Matt Liotta
R337 Consulting LLC
http://r337.com


On May 10, 2004, at 10:24 AM, Brian Kotek wrote:

> Thanks Matt.  If you have it handy, I'd be interested to see the
> additional code needed to pass arguments to the constructor.  If it's a
> hassle then don't worry about it.
>
> Overall, is this a common approach in Java, or is dynamic instantiation
> frowned upon?
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of Matt Liotta
> Sent: Monday, May 10, 2004 10:14 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [CFCDev] OT: Dynamic class instantiation in Java?
>
> Class clazz = Class.forName("package.ClassName");
> clazz.newInstance();
>
> If you want to actually pass parameters to the constructor then there
> is a whole lot more code needed.
>
> Matt Liotta
> R337 Consulting LLC
> http://r337.com
>
>
> On May 10, 2004, at 10:06 AM, Brian Kotek wrote:
>
>> Off topic but I thought someone here might know the answer.  Is it
>> possible to dynamically instantiate a class in Java?  Similar to how
>> you
>> could do:
>>
>> <cfset myObjVar = "someComponent" />
>> <cfset myObj = createObject( 'component', '#myObjVar#' ) />
>>
>> In other words, to instantiate a class in Java when you won't know
>> until
>> runtime what class you want to instantiate?
>>
>>
>> Thanks,
>>
>> Brian
>>
>> ----------------------------------------------------------
>> You are subscribed to cfcdev. To unsubscribe, send an email
>> to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
>> in the message of the email.
>>
>> CFCDev is run by CFCZone (www.cfczone.org) and supported
>> by Mindtool, Corporation (www.mindtool.com).
>>
>> An archive of the CFCDev list is available at
>> www.mail-archive.com/[EMAIL PROTECTED]
>>
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
> in the message of the email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).
>
> An archive of the CFCDev list is available at
> www.mail-archive.com/[EMAIL PROTECTED]
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
> in the message of the email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).
>
> An archive of the CFCDev list is available at
> www.mail-archive.com/[EMAIL PROTECTED]
>

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to