Java Script executeScript(String strScript)

Here you can find the source of executeScript(String strScript)

Description

execute Script

License

Apache License

Declaration

public static void executeScript(String strScript) throws ScriptException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import javax.script.*;

public class Main {
    public static void executeScript(String strScript) throws ScriptException {
        // create a script engine manager
        ScriptEngineManager factory = new ScriptEngineManager();
        // create a JavaScript engine
        ScriptEngine engine = factory.getEngineByName("JavaScript");

        // evaluate JavaScript code from String
        engine.eval(strScript);// w w w .j a v  a2  s .com
    }
}

Related

  1. eval(String script)
  2. evaluateExpression(String expr)
  3. evaluateExpression(String s)
  4. executeAppleScript(String script)
  5. executeScript(String script)
  6. fillStringCollection(ScriptObjectMirror som, Collection collection)
  7. generateToken(String val)
  8. getBallerinaFromJsonModel(String jsonModel)
  9. getDynamicInput(String key)