我需要从类似于this issue的java bean调用ssjs 。问题是我需要执行的代码来自配置文档,可能看起来像:
getComponent("xxx").getValue();
我已经建立了一个版本:
String compute = doc.getItemValueString("SSJSStuff");
String valueExpr = "#{javascript:" + compute + "}";
FacesContext fc = FacesContext.getCurrentInstance();
Application app = fc.getApplication();
ValueBinding vb = app.createValueBinding(valueExpr);
String vreslt = vb.getValue(fc).toString();
但我明白了"Exception in xxx: com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript computed expression"
我想我已经很近了,但我看不到山那边..有什么想法吗?