I need to call ssjs from a java bean similar to this this issue. The issue is that the code I need to execute comes from a configuration document, and may look like:
getComponent("xxx").getValue();
I have built a version that does :
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();
but I get "Exception in xxx: com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript computed expression"
I think I am close, but I do not see over the hill.. Any thoughts?