A way to access the session attribute value from applets

A way to access the session attribute value from applets
First, the applet would have to know the current session id, so you would need to put the applet in a jsp, and dynamically create an applet parameter that contains the session id.

Then you would need to use a URLConnection to connect to the servlet, and pass the session id to the server, either as a cookie value or using url rewriting.

Once you have done that you can create ObjectInputStream's and ObjectOutputStream's on both the applet and servlet side to pass the required session variables.

Just note, that this would mean the applet is actually going to download the object to the client side, so it might be a bad idea if your application runs over the internet. And this also means your applet would need to be signed. 

你可能感兴趣的:(A way to access the session attribute value from applets)