Hello all,

I'm using Rhino to write server side logic inside a servlet container.

>From the docs I understand that initStandardObjects is expensive so I
call it once and put the resulting scope it in a static variable.  I
also seal the scope to use it from all servlets/threads without
conflicts. Then for every request I create another scope where I will
put the request parameters.

So far so good. Now the problem is that I want to use the Javascript
Templates from Trimpath
(http://code.google.com/p/trimpath/wiki/JavaScriptTemplates), I load
the library in a String (is small) and do:

rhinoContext.evaluateString(newScope, stringWithTrimpathCode,
"js/trimpath-template-1.0.38", 1, null);

but I get the following error:

org.mozilla.javascript.EvaluatorException: Cannot modify a property of
a sealed object: RegExp. (js/trimpath-template-1.0.38#115)

I suspect that many libraries will trigger the same issue, is there a
workaround for that in the context of a servler container?

Thanks
Jaime
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to