Subj : Re: newbie question To : Dani Irinchev From : Igor Bukanov Date : Mon Apr 19 2004 03:10 pm Dani Irinchev wrote: > Hi all, > I would like to use rhino for some scripting extension of a java software. I > can deliver java objects to the scripting environment, everything fine. I > would like to expose some methods to the js script that to be callable > directly, as I see in some js scripts print() method defined. For now I > expose another object e.g helper and call helper.print("...") from my > script. Is it possible to expose print() directly as it was a js function. See description of defineFunctionProperties at http://www.mozilla.org/rhino/apidocs/org/mozilla/javascript/ScriptableObject.html and http://www.mozilla.org/rhino/apidocs/org/mozilla/javascript/FunctionObject.html See also the source of org.mozilla.javascript.tools.shell.Global constructor which defines print and all other shell functions for Rhino shell: http://lxr.mozilla.org/mozilla/source/js/rhino/toolsrc/org/mozilla/javascript/tools/shell/Global.java#58 Regards, Igor .