日期:2014-05-20 浏览次数:20671 次
ScriptEngineManager mgr = new ScriptEngineManager(); ScriptEngine engine = mgr.getEngineByExtension("js"); String result = null; try { result = engine.eval(expression).toString(); } catch (ScriptException ex) { System.out.println("报错:" + ex); }