In JRE1.4.2, the prompt does not have permission issues when the JavaScript call has been signed by JavaScript call.

xiaoxiao2021-03-06  109

In JRE1.4.2, if it is JavaScript to use the Applet method, even if the user has trusted the signature of this applet, there may be a problem that the permissions are not enough, but if the applet calls the method, there is no problem, for this, You can start a thread in the start method in the applet, this thread has sufficient permissions, then interacts in the JavaScript method, the following is the code public class myapplet extends applet {thread thread; string command; Object Result; Boolean isend = FALSE;

Public void start () {thread = new thread (new ruid run () {whele (! isend) {type {synchronized (thread) {thread.wait ();}} catch (exception e) {e .printStackTrace ();} if (isend) return; try {if ("callexe" .equals (command)) Result = callexe ();} catch (exception e) {E.PrintStackTrace ();} synchronized (cardapplet.this) ) {Cardapplet.this.notify ();}}}}; thread.start ();

Public void stop () {iesend = true; synchronized (thread) {thread.notify ();}}

String call () {this.command = "callexe"; try {synchronized (thread) {thread.notify ();} synchronized (this) {wait ();}} catch (exceptstacktrace (); } Return Result;} String CallexE () {// Todo Add Logic Here Return NULL;}

}

转载请注明原文地址:https://www.9cbs.com/read-103219.html

New Post(0)