aspose file tools*
The moose likes JSP and the fly likes A query regarding the one-to-one chat module Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "A query regarding the one-to-one chat module" Watch "A query regarding the one-to-one chat module" New topic
Author

A query regarding the one-to-one chat module

Jignesh Gohel
Ranch Hand

Joined: Dec 28, 2004
Posts: 276
Hello,

I have made a general chat application using JSP & Servlets.
Now i am making an additional one-to-one chat module in my application.

So if you could please give me a suggestion about this one-to-one chat module ie ,how to make it possible that when i send one message which should be personaly viewed by intended user, it gets displayed on the intended users window .

Temporary i have written the servlet code for sending the message by the user who wants it to be received by the intended user using a simple textfield & send button & i am successful in sending the message ie on the JSP side I'm getting the message printed with the sender's name.

Now how to approach for making the intended user receive the message personally on his own window/page if he is chatting with me(for e.g).

My whole user interface has been made using HTML & JSP code inside it.

Thanking you,
Jignesh


Regards,
Jignesh

The Art Of Life Is To Know When To Be Useless And When To Be Useful - CHUANG TZU
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30749
    
156

Jignesh,
You need to have the page periodically query the server to see if there are new messages. Take a look at gmail for an example of this.

On the server you need to keep track of who the message is for. Then when a certain id checks to see whether there are messages, you can check the id.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jignesh Gohel
Ranch Hand

Joined: Dec 28, 2004
Posts: 276
hello,
Thanks for your reply.
You said,
On the server you need to keep track of who the message is for. Then when a certain id checks to see whether there are messages, you can check the


But sir i don't know --on the server side how to keep track of who the message is for???
So if you could help me make understand through a small snippet of sample code ,I would be very much grateful to you.

Thanking you,
Jignesh
Sarath Mohan
Ranch Hand

Joined: Mar 17, 2001
Posts: 213
Hi,
If a user sends a message you encode sender info along with the message.Parse the message to idetify who sends the message. You can also encode reciipient in the message if it is a private or one-to-one message.

Cheers


Sarath Mohan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A query regarding the one-to-one chat module