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

ch praveen
Ranch Hand

Joined: Mar 08, 2004
Posts: 67
Hello Friends,
Iam developing a chatting program. I approached the scenario that is implemented in [Object Based Http Access] and To be more specific I implemented a polling mechanism where a client constantly checks the server for the next message. Here messages are not strings, they are objects containing extra details such as userid,roomid and so on. Iam getting many problems which are listed below::
[NOTE:: At present Iam maintaing only one room]
[1] When messages are passed like a flood to the server, the respective user's browser is getting struck.
[2] I have created a hashtable containing users details once they logged in and stored it in a ServletContext so all clients (users) could get the details of users logged into the room. In Applet's init() method I implemented a Applet-Servlet Communication which connects to the server and gets the users details like a Enumeration Object and adds details to the List. But this thing is not happening (Listbox is not filled). Can't we implement Applet-Servlet Communication in an applets init() method.
[3] Iam using Tomcat as a webserver. Even though I have stopped the server and restarted it, it is remembering the previous details [i.e Servlet Context Attributes details - Hashtable containg users details] such as users details and making the things much worse for me.
Any Of Your suggestions Are Highly Appreciated.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

ch prv, it is great to see that you are working hard on your project, you will find that you will learn quite a bit, and the frustrations now, will have a great payback at the end.
However, you still need to adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it

Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Applet_Servlet Communication
It's not a secret anymore!