Question

I would like to call on an own Java-method from a JavaScript-file via the ScriptEngineManager provided in Java 1.6. Is that possible?

Was it helpful?

Solution

Yes: http://www.mozilla.org/rhino/ScriptingJava.html

There are many ways of doing it. The Java code can push references to Java objects into the global context, which will look kind-of like what DOM objects look like to browser Javascript. Or Javascript can instantiate Java objects and reference them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top