Java:如何将参数传递给 Webstart Applet?
场景:服务器向许多不同的(但经过身份验证的)客户端提供相同的 Webstart Applet。每个Applet 都必须“知道”它位于哪个客户端上。因此,服务器必须能够将一些参数传递给客户端,然后由该客户端上运行的 Applet 读取这些参数。
- Webstart Applet 是否可以访问启动它的网络浏览器的 cookie?
- Webstart Applet 是否可以访问其识别的URL?
- 还有其他选择吗?
编辑:也许 Webstart Applet 是一个错误的术语。我的意思是只是一个 Webstart 客户端应用程序。
Scenario: server provides same Webstart Applet to many different (but authenticated) clients. Each Applet has to "know" which client it is on. Therefor the server has to be able to pass some parameters to the client, which is then read by the Applet, running on that client.
- Is it possible for a Webstart Applet to access the cookies of the web browser from which it was launched?
- Is it possible for a Webstart Applet to access the URL by which it was identified?
- Some other options?
EDIT: Perhaps Webstart Applet is a wrong term. I mean just a Webstart Client App.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅
applet-desc<
元素rel="nofollow">JNLP 文件语法 了解详细信息。
附录:另请参阅访问 Cookie 。
See the
applet-desc
element in JNLP File Syntax for details.Addendum: See also Accessing Cookies.
更多与您的第二点有关的内容。 URL 查询参数可以使用 JavaScript 进行解析并添加到
applet
元素中。applet
元素中的属性将添加或覆盖 JNLP 文件中设置的值。More pertaining to your 2nd point. URL query parameters can be parsed using JavaScript and added to the
applet
element. Attributes in theapplet
element will add to, or overwrite, the values set in the JNLP file.