Rhino: How to pass Java object to script, where can be referenced as “this”
问题 I am new to JSR-223 Java Scripting, actually I'm switching from MVEL to standard Mozilla Rhino JS. I have read all documentation, but get stuck. I have tried to reference some Java objects from script by bindings just like in tutorial: // my object public class MyBean { public String getStringValue() { return "abc" }; } // initialization ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = manager.getEngineByName("JavaScript"); // add bindings engine.put("bean", new