使用 Applet 的 JAX-WS 客户端

发布于 2024-10-18 13:25:41 字数 368 浏览 1 评论 0原文

当我通过使用 Applet 客户端将 JAX-WS 架构与会话管理结合在一起时,我似乎陷入了一个有问题的场景。

为了维护会话,我向客户端端口添加了以下属性 BindingProvider.SESSION_MAINTAIN_PROPERTY

然而,问题是,当我同时调用小程序的两个实例(在两个选项卡上访问网站)时,会话会在两个客户端之间混合。我怀疑这与多个 applet 实例使用同一个 JVM 实例,因此静态代码在它们之间共享这一事实有关。但是,我无法弄清楚这两个实例中都使用了哪个部分。

我已经证实,会话混合的问题仅在从同一个浏览器同时运行实例时发生,即共享 JVM 静态代码时。换句话说,会话管理代码在我测试过的任何其他情况下都可以正常工作。

It seems like I'm falling into a problematic scenario when combining JAX-WS architecture together with session management all that by using Applet client.

In order to maintain session I've added to the client's port the following property BindingProvider.SESSION_MAINTAIN_PROPERTY.

However, the thing is that when I invoke two instances of the applet (accessing the website on two tabs) simultaneously, the session gets mixed between the two clients. My suspicious is that this has to do with the fact that multiple applet instances use the same JVM instance and thus, static code is shared between them. However, I cannot figure out which part is being used in both instances.

I've positively verified that this issue of session mixture only occurs when running instances simultaneously from the same browser, i.e. when JVM static code is shared. In other words, the session management code works correctly in any other case that I've tested.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

腻橙味 2024-10-25 13:25:41

..我怀疑这与多个 applet 实例使用同一个 JVM 实例有关..

来自 下一代 Applet Java 插件技术

执行小程序的新方法

执行 applet 的新方法在架构上与 Java Web Start 技术相似,但与浏览器集成更紧密。 Applet 不再在 Web 浏览器内的 Java 虚拟机 (JVM) 中执行。相反,启动一个单独的 JVM 机器进程来执行小程序。默认情况下,仅启动一台 JVM 机器,但您有机会启动多个 JVM ...

(强调我的)

测试您的怀疑。

..My suspicious is that this has to do with the fact that multiple applet instances use the same JVM instance ..

From a page on the Next Generation in Applet Java Plug-in Technology.

A New Way of Executing Applets

The new way of executing applets has architectural similarities to Java Web Start technology, but tighter browser integration. Applets no longer execute in a Java Virtual Machine (JVM) inside the web browser. Instead, a separate JVM machine process is launched to execute applets. By default, only one JVM machine is launched, but you have the opportunity to launch more than one JVM ...

(Emphasis mine)

Test your suspicions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文