从另一个 Java 小程序访问 Java 小程序 [英] Accessing Java applet from another Java applet

查看:28
本文介绍了从另一个 Java 小程序访问 Java 小程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Web 应用程序使用 Java 小程序,该小程序将用户提交的密码存储在私有属性中,并在多个公共方法中使用此属性.

A web application uses a Java applet that stores a password, submitted by the user, in a private property and uses this property in several public methods.

我想知道从同一个或不同网站加载的另一个Java小程序是否有可能调用这个小程序的方法或可能访问包含密码的私有属性?

I wonder if it is possible for another Java applet loaded from the same or different web site to call the methods of this applet or possibly access the private property containing the password?

不同的小应用程序是在相同的还是不同的 JVM 中运行?如果它们在同一个 JVM 中运行,一个小程序能否以某种方式获得对另一个正在运行的小程序的引用?

Do different applets run in a same or different JVMs? If they run in the same JVM, can one applet somehow get a reference to another running applet?

密码存储小程序已签名.我假设想要获取密码的窥探小程序也可以签名.

The password-storing applet is signed. I work from assumption that the snooping applet that wants to get the password can also be signed.

推荐答案

您可以使用 AppletContext 以获取从一个小程序到另一个小程序的引用.如果要调用 Applet 类本身定义的公共方法以外的任何公共方法,当前的小程序必须知道将结果类型转换为什么.

You can use AppletContext to get a reference from one applet to another. The current applet will have to know what to typecast the result into if you want to call any public methods other than those defined by the Applet class itself.

这篇关于从另一个 Java 小程序访问 Java 小程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆