Applet method calling from Javascript

前端 未结 1 363
花落未央
花落未央 2020-12-02 02:18

I have an applet to upload some files from specific folder and delete them,but something is wrong when I call an applet function from my javascript code, when I call that fu

相关标签:
1条回答
  • 2020-12-02 02:50

    The interaction of Java and JS complicates security. The JRE cannot trust the JS, so it decides the entire 'chain of operations' that include your code is untrusted. There is a way to fix it.

    The code needs to be wrapped in a PrivilegedAction and called using one of the AccessController methods that doPrivileged(..). Look at the top of the AccessController docs. (above the methods) to see example usage.

    0 讨论(0)
提交回复
热议问题