title: Defining a default/global Java object to Nashorn script engine?
body: <p>With Java's Nashorn script engine, I can provide objects in the context of an eval() using bindings like so:</p>
  
  <pre><code>Bindings bindings = scriptContext.getBindings(ScriptContext.ENGINE_SCOPE);
  bindings.put("rules", myObj); 
  scriptEngine.eval("rules.someMethod('Hello')", scriptContext);
  </code></pre>
  
  <p>I'd like to be able to simplify the javascript by providing a default object, so that instead of the javascript being:</p>
  
  <pre><code>rules.someMethod('Hello')
  </code></pre>
  
  <p>I can just write:</p>
  
  <pre><code>someMethod('Hello')
  </code></pre>
  
  <p>Is there any way to accomplish this? (someMethod is a method on an object, not a static method)</p>