File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes applet servlet communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "applet servlet communication" Watch "applet servlet communication" New topic

applet servlet communication

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944

hello friends
I am facing a problem in applet-servlet communication .I am creating a quiz applet.But my servlet is not able keep session.I have used httpsession object. I am using web sphere test env. as server.Do you have any solution.Session API for servlets is not working.If you know any solution about it please mail me.
I will be very thankful for your guidence .
paul wheaton

Joined: Dec 14, 1998
Posts: 20971

The problem is that the browser has a different session than the applet. The servlet stuff provides a solution, but only through deprecated methods that, at least in JRun, don't work reliably.
The solution is to have a singleton that contains a hashtable of data objects on your servlet side: make your own custom session stuff - it's pretty simple. The only difficult part is setting up a thread that kicks off every few minutes to delete old data.

permaculture Wood Burning Stoves 2.0 - 4-DVD set
I agree. Here's the link:
subject: applet servlet communication
jQuery in Action, 3rd edition