JavaScript in Mustang
Submitted by kebernet on Mon, 08/08/2005 - 15:44
Tagged:
David Flanagan has this look at using the new javax.script package in Mustang and it's associated JavaScript interpreter...
Sorry about the spacing. [Ed note: - modified story to fix spacing] It is a byproduct of the way the penguin publishes.
ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = Manager.getEngineByExtension("js"); // Use our own name/value pairs as JavaScript variables Bindings bindings = new SimpleBindings(defaults); // Create a context for evaluating scripts in ScriptContext context = new SimpleScriptContext(); // Set those Bindings in the Context so that they are readable // by the scripts, but that variables defined by the scripts do // not get placed into our Map object. context.setBindings(bindings, ScriptContext.GLOBAL_SCOPE);







Comments
RE: JavaScript in Mustang
RE: JavaScript in Mustang
RE: JavaScript in Mustang
RE: JavaScript in Mustang
RE: JavaScript in Mustang