Here you can find the source of scriptEngine(String epStr, Map per)
public static Object scriptEngine(String epStr, Map per) throws ScriptException
//package com.java2s; //License from project: Apache License import java.util.Iterator; import java.util.Map; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; public class Main { public static Object scriptEngine(String epStr, Map per) throws ScriptException { ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = manager.getEngineByName("js"); for (Iterator iterator = per.keySet().iterator(); iterator.hasNext();) { String type = (String) iterator.next(); engine.put(type, per.get(type)); }/* www . j ava2s . co m*/ return engine.eval(epStr); } }