• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Chat Application

 
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..
 
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use Socket Programming in java to make such an application. You can find tutorials online search through www.google.com
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"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
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"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!
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic