Re: calling java from a javascript XPCOM component

From: Andrew Harrison <A.B.Harrison_at_cs.cardiff.ac.uk>
Date: Tue, 18 Oct 2005 08:40:03 +0100

Hi Stefano,

Many thanks for your help on this. I looked at those two files, but
will make a deeper investigation.

thanks again,

Andrew

On 17 Oct 2005, at 23:25, Stefano Mazzocchi wrote:

> Andrew Harrison wrote:
>> Hi,
>> This is really a general question. Piggybank seems to be able to
>> create Java object from within a Javascript component. Could anyone
>> explain how this was achieved? I've got LiveConnect working in the
>> JavaScript on an html page, but when I try the same thing from within
>> a component it doesn't work. So somehow I need to tell Firefox to
>> use the LiveConnect when it's loading the component, but I can't work
>> out how.
>> Any help appreciated.
>> cheers,
>> Andrew
>> PS - I'm on a Mac - but like I say, I've got the LiveConnect working
>> in an html page.
>
> Andrew,
>
> the xpconnect subsystem (the one that wraps XPCOM) is *not* conneced
> to LiveConnect, so you have to pass the "java" object from an actual
> web page to "enable" it.
>
> Look into nsPiggyBank.js and nsClassLoader.js, those are the files
> that control the whole system. nsClassLoader especially contains a lot
> of the black magic of classloading and policy settings that you need
> to enable the JVM integration.
>
> We should write a "how to write xpcom components in java" howto, but
> boy, so much work to do :-/
>
> --
> Stefano Mazzocchi
> Research Scientist Digital Libraries Research Group
> Massachusetts Institute of Technology location: E25-131C
> 77 Massachusetts Ave telephone: +1 (617) 253-1096
> Cambridge, MA 02139-4307 email: stefanom at mit . edu
> -------------------------------------------------------------------
>
Received on Tue Oct 18 2005 - 07:30:53 EDT

This archive was generated by hypermail 2.3.0 : Thu Aug 09 2012 - 16:39:18 EDT