I've started to run into some really annoying problems using JSR223's interfaces to Rhino:
- poor exception information (see my other SO question)
- inability to use ScriptableObject (it would be nice to set the Javascript
foo
variable to a Javascript value with properties so that I can setfoo.bar
to something andfoo.baz
to something else. JSR223 just lets me set root global variables to Java values.) - inability to set read-only variables/properties
If necessary, I'd consider switching to Rhino as a native scripting engine, but that comes with the pain of not being able to support other languages without a bunch of extra effort.
Is there any better abstraction layer besides JSR223?
I've heard of Bean Scripting Framework but am not sure how it's different/worse/better. I also ran across Scripturian and have no idea a开发者_开发技巧bout that.
Not really an answer, but from my humble limited exploration jsr223 and bsf are rather simple and do not really address more powerful embedding. If you really want better integration you need to use the native bridge.
精彩评论