Hi ! I'm currently trying to add BSF+Jython support in the ZK framework (www.zkoss.org). To make this I need to have a method called, each time the scripting language tried to get the value of a variable.
For example the Groovy support in ZK is done this way: ======================================= import groovy.lang.Binding; import groovy.lang.GroovyShell; ... public void init(Page owner, String zslang) { super.init(owner, zslang); _global = new Binding(new Variables()); _ip = new GroovyShell(_global); } //An inner class of GroovyInterpreter private class Variables extends HashMap { public Object get(Object key) { Object val = super.get(key); if (val != null || containsKey(key) || !(key instanceof String)) return val; return getFromNamespace((String)key); //provided by GenericInterpreter } } ======================================= (More can be read here: http://www.zkoss.org/smalltalks/addinterpreter/addinterpreter.dsp) So with groovy, you can register an 'object container' to intercept accesses. If the object is already set in the scripting language, then return it, but if it is not set, it tries to return a ZK object with the same name (using the ZK method getFromNamespace()). I do not see how it could be done with BSF. I cannot register new BSF Beans, because, new ZK objects can be created at any time, so I do not know their names to register them. I need something dynamic, something which is called just before the scripting language tried to use an object. Did I miss something in BSF, or do I need to use the Jython API instead ? Best regards, -- Ludovic Drolez. http://zaurus.palmopensource.com - The Zaurus Open Source Portal http://www.drolez.com - Personal site - Linux and PalmOS stuff --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]