Jeffrey Hau wrote:
I am just starting with batik and try to run a very simple script
within a SVG document. The script is just the function below,
function callJava() {
var cx = Packages.org.mozilla.javascript.Context.enter();
alert(cx);
}
Hi Jeffrey,
We don't allow access to this class from javascript for
security reasons. I just noticed that there this is not controlled
(as it should be) by the User Agent security settings, so the
only way to work around this would be to modify the Batik sources
(in particular either modify batik.script.rhino.RhinoClassShutter
or RhinoInterpreter so it never registers a class shutter).
but when i run this within the squiggle browser, i get the following error
TypeError: [JavaPackage org.mozilla.javascript.Context.enter] is not a
function. (Inline <script> file:/Projects/svg/lines.svg:6; line 3)
at
org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java: 597)
at
org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java: 557)
at
org.mozilla.javascript.NativeGlobal.typeError1(NativeGlobal.java:567)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1182)
(rest of the trace omitted)
the code execute ok within the standalone rhino shell, so i think this
is probably a classpath setting problem.
i try runnning the browser in the batik installation directory by
java -jar batik-squiggle.jar
and also (as a user suggested in an earlier post),
java -cp batik-squiggle.jar:lib/js.jar
org.apache.batik.apps.svgbrowser.Main
but neither works, can anyone help?
thanks very much
Jeff
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]