jakarta-bsf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Hahnekamp <rainer.hahnek...@aon.at>
Subject Re: general questions
Date Sun, 31 Oct 2004 00:02:53 GMT
Hi,
thank you very much for your quick answer.

Unfortunately I think, that you misunderstood me a little bit. So let me try 
to explain my problem in more detail with following example:
I want to make use of the jdom-library in my script code. So the first row of 
the javascript-code would be:

sax = new org.jdom.input.SAXBuilder();

By executing this code I get the error message: "org.apache.bsf.BSFException: 
JavaScript Error: Internal Error: undefined: "org" is not defined."

I assume that I can only access the standard java api as you did in your 
mentioned example scripedui with the AWT Objects. But if I want to use some 
functionality of an external library I have to do the instantiate&register 
process, which would be - in my case (OpenOffice API & jdom) - an impossible 
work.

Greetings,
-Rainer Hahnekamp

On Sunday, 31. October 2004 00:49 Ulf Dittmer wrote:
> Hi-
>
> Maybe I misunderstand what you're trying to accomplish, but the
> instantiation and registering should only be necessary if the host app
> wants to make particular objects -which originate in the host-
> available to the script. If the objects don't have to originate in the
> host (because the host needn't access them), you should be able to
> create them in your script. How exacly that's done depends a bit on
> which scripting language you're using. Take a look at the "scriptedui"
> example that comes with BSF: the Java host registers a bean, but
> several more Java objects -which the host needn't care about- are
> instantiated in the script (e.g., ui.js for JavaScript).
>
> Hope this helps.
>
> Ulf
>

---------------------------------------------------------------------
To unsubscribe, e-mail: bsf-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-user-help@jakarta.apache.org


Mime
View raw message