开发者

java security error when loading dll from a Javascript call but not when directly called from applet

I have an applet the loadslibrary using a System call through a static method called loadLibrary.

System.loadLibrary("ReadRegistry");

This works fine as long as I call loadLibrary from within the applet. However, if from javascript开发者_JS百科 I access another method, called handleLoad(), which calls the loadLibrary method, I get a java security error when I try to call the System.loadLibrary statement.

Why would that be?


Once a call is invoked by JS, a JRE becomes less trusting of it.

To solve that, wrap the problem code in a PrivilegedAction and call it using one of the AccessController.doPriviliged() variants.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜