File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

chat room, where should i start?

 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
i am writing a chat room on an intranet site.
there are should be a main text window, an 'entry' text field
and a window to display all user, perhaps something else.
I am mostly intrested in a mechanism ( servlets or applets, and how to build send-recieve system.
any suggestions are appreciated.
artur
 
Val Dra
Ranch Hand
Posts: 439
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i have builded a chat system using servlets it works out prety well , if you'd like i can send you the files for it. One drawback is that it requires a serversocket so i can't show you an example because non public servers allow you to open serversocket on their servers. Let me know.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Val, would you consider just giving us a summary of how it works - so that we get the gist. Just for educational purposes of course .
 
Val Dra
Ranch Hand
Posts: 439
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi , i can try to explain but i am not good at explaining certain things.
I am not an expert in java or servlets but this is how i implemented this chat to get it to work.
I had 3 frames on html page. One called Chat servlet which generates dynamic html on the fly. 2nd one was a user list also dynamicly shows all the users which come and go from the chat and 3rd one was the Footer servlet. Now Chat servlet is responsive for reading messages send by other users and just formatting the messages simple nothing more. User servlet just reads users from a collection which are connected to the server and display their names . It also has ignore / and private message set up so that you can send or ignore(controled by clicking a checkbox on html) this is done though the javascript part. When this happends the user who was just ignored recieves the notification that he no longer can send messages to the other person. Private message works by clicking on the user name(link) which places user name into a textfield on html and when you send a message the messege will be delivered only to this person with indication from whom it was.
Last part is the Footer which is actually just sending messages to all the clients or privately. How i did it was simple. I had a server class which listens on certain port. When user first connected though Signin page he gets a socket. Now Server class is responsible for sending the messages to all the clients and etc. Sorry don't know how clear i explained it if something is not clear let me know i'll try to explain it better
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that I got it!! Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic