wood burning stoves
The moose likes Servlets and the fly likes Simple Chat Program HTTP / Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Simple Chat Program HTTP / Servlets" Watch "Simple Chat Program HTTP / Servlets" New topic

Simple Chat Program HTTP / Servlets

Robert Darling
Ranch Hand

Joined: Jun 21, 2008
Posts: 100


I am writing a simple chatting programming built over HTTP and allows people to chat with each other.

The way i am proposing to build the chat servlet, is that when a user logs into the servlet with a user name and password i return the user id of the person over the response object. I also put the user id of the person along with the response object into a global hashtable. When a person say user_id 1 wishes to chat with a person say user_id 2, i read the global hashtable and obtain the user id 2 response object. On the response object i send the message that user_id 1 wants to send to user_id 2.

Could anyone tell me if this method works, or would they be a better way of achieving the above task. I know off course HTTP is connectionless so how else can we send a response to a user who has not initiated a request.

Kind Regards

I agree. Here's the link: http://aspose.com/file-tools
subject: Simple Chat Program HTTP / Servlets
It's not a secret anymore!