title: Secure Nashorn JS Execution
body: <p>How can I securely execute some user supplied JS code using Java8 Nashorn?</p>
  
  <p>The script extends some computations for some servlet based reports. The app has many different (untrusted) users. The scripts should only be able to access a Java Object and those returned by the defined members. By default the scripts could instantiate any class using Class.forName() (using .getClass() of my supplied object). Is there any way to prohibit access to any java class not explicitly specified by me?</p>