简体   繁体   中英

JAX-WS client using Applet

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, ie when JVM static code is shared. In other words, the session management code works correctly in any other case that I've tested.

..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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM