admin管理员组文章数量:1277885
When embedding a JavaScript interpreter (Rhino) into a Java application (to be able to script that application), how would one go about restricting the Java packages that are available to scripts? For example, only "java.lang.*" should be accessible.
When embedding a JavaScript interpreter (Rhino) into a Java application (to be able to script that application), how would one go about restricting the Java packages that are available to scripts? For example, only "java.lang.*" should be accessible.
Share Improve this question edited Apr 11, 2009 at 7:16 womp 117k26 gold badges239 silver badges271 bronze badges asked Apr 7, 2009 at 1:41 ThiloThilo 263k105 gold badges522 silver badges671 bronze badges2 Answers
Reset to default 9A method for blocking access to certain packages and classes (including through reflection) in Rhino is described here. The important interface is ClassShutter which provides access control for Rhino's LiveConnect support.
how about just saying:
java = undefined; = undefined; Packages = undefined;
in an initial script which is loaded first.
本文标签: Rhino restrict Java packages that can be accessed from JavaScriptStack Overflow
版权声明:本文标题:Rhino: restrict Java packages that can be accessed from JavaScript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741287050a2370332.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论