beadrsh a écrit :
> Many thanks for the reply. I typed in the following
> 
> Context cx = Context.enter();
> Scriptable scope = cx.initStandardObjects();
> person p1 = new person();
> p1.name = "beadar";
> ScriptableObject.putProperty(scope, "p1", p1);
> FileReader script = new FileReader("check.js");
> Object result = cx.evaluateReader(scope, script,"<cmd>", 1, null);
> System.out.println(result);
> 
> and in the check.js
> 
> result = "Hello " + p1.name
> 
> 
> 
> but in the result it prints     "Hello undefined"     .Am i missing
> something here.Any help would be greatly appreciated

Try making your field public:
class person{
        public String name;
}

Christophe
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to