Applet URLConnection.connect fails after being called from JavaScript

前端 未结 1 1529
轮回少年
轮回少年 2021-01-21 18:15

I have a website with a Java Applet and that applet needs to connect to my server. This works in JApplets @Override init() but not in my own functions that are being called by j

1条回答
  •  礼貌的吻别
    2021-01-21 18:16

    Try something along the lines of:

    public void callFromJavaScript(final String param) {
        AccessController.doPrivileged( new PrivilegedAction() {
            public Void run() {
                // call code to make the connection..
                return null;
            }
        });
    }
    

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