jQuery in Action, 2nd edition*
The moose likes JSP and the fly likes Chat Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Chat Application" Watch "Chat Application" New topic
Author

Chat Application

Sri Gnana
Ranch Hand

Joined: Apr 29, 2004
Posts: 166
Hi,
I like to do the chat application in Java Technologies, can i use jsp & servlet with JScript, or Applet. Please tell me , and where can i get the code samples and help.
Regards
Sri..


Thanks & Regards
Sri Gnana
Everythings Programmed!...
Ali Gohar
Ranch Hand

Joined: Mar 18, 2004
Posts: 572
You can use Socket Programming in java to make such an application. You can find tutorials online search through www.google.com
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

"Sri ..",
You'll find this forum a great place to seek help on JSP pages, and there aren't many rules you'll have to worry about, but one is that proper names are required. Please take a look at the JavaRanch Naming Policy and change your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
Thanks!
bear
JSP Forum Bartender


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

"Sri .." -

Welcome to the JavaRanch! We don't have many rules around the 'Ranch, but we do require your display name to follow the JavaRanch Naming Policy.
You can change it here.

To make a chat application, you'd pretty much want to use an Applet and use RMI or sockets for it to communicate. (If you decide to go this route, you can get help on these topics in the "Distributed Java" or "Sockets & Network Protocols" forums here on JavaRanch.) You *could* make a chat application using Servlets/JSPs, but it would require you to constantly update the page, and really isn't that great of an idea.

Thanks! and welcome to the JavaRanch!


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
ch praveen
Ranch Hand

Joined: Mar 08, 2004
Posts: 67
Hello Friends,
What is the best approach for chatting. For example if we implement Sockets, then chat application may not run under firewalls. If we implement HTTP chatting, network overhead will occur. Can any one of you guess what type of chat mechanism is implemented in chat.yahoo.com [polling method(http) or sockets or ..... ].
Regards,
Ch.Praveen.
Harry Wood
Greenhorn

Joined: Jan 28, 2004
Posts: 16
Yahoo uses a big applet, but it's difficult to tell how the applet communicates to the server. Yahoo also used to offer a plain HTML version of the chatroom. Not sure if it still does.
The normal approach is sockets or RMI, but it is also possible to send HTTP requests from an applet back to the server. You can even send serialised java objects over this connection. Works quite well actually. The HTTP requests go through firewalls no problem (looks like normal browser traffic to the firewall), but it will require the applet to be signed (and new users have a big ugly security warning message, where they have to 'trust' the applet)
Plain HTML based chat rooms are possible. here's a good example: http://chat.nme.com/ Look at the HTML headers to see how the refreshing works. Really this is not what the technology was intended for. Imagine what's happening in your webserver log files, when every chatter is refreshing so often. It's not a scaleable approach.
Also from past experience, you should give careful consideration to whether you really want a chatroom on your site. If your site doesn't get many visitors, then a chatroom will only serve to underline that fact, since it will always be empty! Start by implementing discussion forums. If these start to get really lively (100s of users and 2 or 3 new posts every minute) then it's worth having a chatroom.
Ashish Agrawal
Ranch Hand

Joined: Nov 02, 2003
Posts: 112
I have implemented a simple chat application using servlets/jsp only. NO applets...no sockets...only pure html and servlets/jsp. What I did is, I set the refresh header to auto refresh after every 5 (or 10) seconds? For each request I am updating client's page.
There are lots of other features like chat rooms, nicknames, etc.
- Ashish Agrawal.
ch praveen
Ranch Hand

Joined: Mar 08, 2004
Posts: 67
Thanks to HarryWood and Ashish Agarwal for valuable suggestions. At present Iam working on Http Chat Application ( my academic project) which is based on applet-servlet communication where serialized objects are passed from applet to servlet. If possible can you send your code snippets for my guidance. Until now I have incorporated public and private chatting. Iam asked to integrate voice chat in this application, which is the big issue now. My doubts are listed below.
[1] Can we integrate voice chat in a Http Based Chat Application which is based on polling mechanism.
[2] Another major problem is the interface part. I must adhere to the AWT components itself as implementing swings requires client to have proper plugin installed and I wonder how Yahoo managed that wonderful look without swings. Eventhough I implemented third party components for getting various font colors in TextArea and for embedding images, it's taking a lot of time for the client to load the chat applet in browser. Again I wonder how Yahoo accomplished this.
Regards,
Ch.Praveen
Sri Gnana
Ranch Hand

Joined: Apr 29, 2004
Posts: 166
Originally posted by Ashish Agrawal:
I have implemented a simple chat application using servlets/jsp only. NO applets...no sockets...only pure html and servlets/jsp. What I did is, I set the refresh header to auto refresh after every 5 (or 10) seconds? For each request I am updating client's page.
There are lots of other features like chat rooms, nicknames, etc.
- Ashish Agrawal.

Hi Ashish Agarwal
can you send me the code archive for my reference, if it's possible..
Thanks & Regards
Sri Gnana
Sri Gnana
Ranch Hand

Joined: Apr 29, 2004
Posts: 166
Hi,
Ali Gohar &
Bear Bibeault
Thanks, I have changed my Display Name, anyway thanks for all
Regards
Sri Gnana
[ April 30, 2004: Message edited by: Sri Gnana ]
 
Consider Paul's rocket mass heater.
 
subject: Chat Application
 
Similar Threads
Java chat application
to create a Java chat application for a firm
APIs/Strategy to be used in developing web-based chat Application using Servlets.
J2EE and JAXM
Free Live Chat integeration