Rhino: restrict Java packages that can be accessed from JavaScript

前端 未结 2 1568
轻奢々
轻奢々 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:07

    A 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.

提交回复
热议问题