File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes chat program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "chat program" Watch "chat program" New topic

chat program

jil shi

Joined: Feb 17, 2004
Posts: 20
i am creating my own web site using jsp. i plan to add 'chat service' like mirc or icq into my web site. how can i create the 'chat'? is there any third party software that i can use?
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121


You can't do a chat application just using JSP... JSP just gets translated down to HTML, and the user has to use HTTP for communication. Basically that means the user has to make a request before the server can generate a response. This communication style isn't condusive to a chat application. To do a chat application you're going to need to embed an applet or some other component (ActiveX, etc.) in the page created by your JSP that can use a communication mechanism other than the request/response style of HTTP to perform the real-time communication needed for a chat application. There are lots of ways to do this, and I'm sure you can find many existing examples of chat applets just by searching google. If you want more information about developing your own chat applet, you could also ask about that specific topic in another forum that it better fits in - Applets, Distributed Java, or Sockets - depending on what you need help with.

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

Joined: Oct 12, 2000
Posts: 5093
It is possible to create a JSP (or PHP, Perl, whatever) based chat application if you use Javascript to refresh the page every second or so.
It's ugly but it works and allows people behind firewalls that pass only HTTP to access the application.

I agree. Here's the link:
subject: chat program
It's not a secret anymore!