如何共享小应用程序之间的数据在同一个网页? [英] How to share data between applets in the same web page?

查看:159
本文介绍了如何共享小应用程序之间的数据在同一个网页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在同一网页几个小程序和我想它们之间共享数据。

I have several applets in the same web page and i would like to share data between them.

什么是做到这一点的最佳解决方案?

What is the best solution to do this ?

编辑:

感谢您的回复,我会尽量更具体:

Thank you for your responses, I will try to be more specific :

我有我的网页上3小程序:

I have 3 applets on my web page :


  • 第一个会从Web服务器下载文件

  • 第二个将用于localY坐标修改文件

  • 第三个会发回修改的文件到服务器

每个小程序将工作中的文件,我想在存储这将小程序之间共享的对象路径,名称和文件的其他属性。

Each applet will work on the files and I would like to store path, name, and other properties of files in an object which would be shared between the applets.

由使用JavaScript小应用程序之间通信的解决方案似乎不适合我的情况非常安全的。

The solution consisting of using Javascript to communicate between applets seems not very secure for my case.

我会阅读更多关于AppletContext。

I will read more about AppletContext.

推荐答案

&Java的LT; - > JS一个很好尝试的方式来获得小应用程序之间的信息,还能看到的 AppletContext

Java<->JS is one well tried way to get information between applets, but see also the AppletContext.

此接口对应于applet的环境:包含applet和其他applet 的同一个文档中的文件

This interface corresponds to an applet's environment: the document containing the applet and the other applets in the same document.

它提供了类似的方法:

  • getApplet(String)
  • getApplets()
  • getStream(String)/getStreams()/setStream(String,InputStream)

一个流是交换信息的一个非常通用而强大的方式。

A stream is a very generic and powerful way to exchange information.

这篇关于如何共享小应用程序之间的数据在同一个网页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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