Rhino: restrict Java packages that can be accessed from JavaScript

前端 未结 2 1528
轻奢々
轻奢々 2021-02-07 20:34

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 av

2条回答
  •  误落风尘
    2021-02-07 21:27

    how about just saying:

    java = undefined; com = undefined; Packages = undefined;

    in an initial script which is loaded first.

提交回复
热议问题