> This is a hack, but you could do the cast in a JSP page and then use
> getPageContext().include(jspPage) to include the page. Don't know if it
> makes more sense to make the addURL call in the JSP as well -- I'd think
> about it since that puts the code in one place.
>
> A Java CFX would be pretty elegant, or a wrapper class like you suggested,
> but this hack should be quick to try.
>
> Regards,
>
> John Paul Ashenfelter
> CTO TransitionPoint
> [EMAIL PROTECTED]
>
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Tuesday, June 11, 2002 4:29 PM
> Subject: CFMX - Casting a java object?
>
>
> > Hi!
> >
> > I'm working with some java classes in MX, and am hoping I can do what I
> > need to do without writing a wrapper class or CFX, but have run across a
> > problem..
> >
> > I'm working with Inktomi Enterprise Search and the XPA Search java
> > interface to the search engine.
> >
> > I'm trying to write a CFC that will allow me to manage search
> > collections.
> >
> > The problem is, I need to cast a java object that I get returned to a
> > different type. Javacast() does not handle this sort of thing, and I'm
> > wondering if there is some other way to cast object types?
> >
> > I'm getting returned an object of type "UltraseekCollection", but I need
> > to cast it to "SpiderCollection" to access the method "addURL".
> > "SpiderCollection" is a subclass of "UltraseekCollection".
> >
> > I'm getting a "method not found" error, as expected, as the method
> > "addURL" doesn't exist in UltraseekCollection.
> >
> > The code is something like this:
> >
> > <cfscript>
> > // create the server object
> > SearchServer =
> > createObject("java","com.ultraseek.xpa.server.UltraseekServer");
> > // call the constructor
> > SearchServer.init("hostname","port");
> > // get my searchcollection - this returns an object of type
> > "UltraseekCollection"
> > SearchCollection = SearchServer.getSearchCollection("collectionname");
> > // now, I want to add a url, but this only can be done with a
> > "SpiderCollection"
> > Success = SearchCollection.addURL("http://www.bob.com/bob.html");
> > </cfscript>
> >
> > Any ideas? I'm guessing that I probably can't do this, though.
> >
> > Thanks in Advance!
> > --
> > Edward Smith Internet Broadcasting System
> > Director of Architecture http://www.ibsys.com
> >
______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics. http://www.fusionauthority.com/signup.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