import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
public class GetEngineByName {
public static void main(String[] args) {
ScriptEngineManager manager = new ScriptEngineManager();
/* Retrieve a ScriptEngine registered with the rhino name */
ScriptEngine jsEngine = manager.getEngineByName("rhino");
if (!(jsEngine == null)) {
System.out.println(jsEngine);
} else {
System.out.println("\nNo supported script engine foundregistered as Rhino.");
}
}
}
|