• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

chat servlet

 
Randall Twede
Ranch Hand
Posts: 4489
3
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found some free code for a chat servlet. I was hoping to add some functionality(dice rolling). it uses this line:
resp.setHeader("refresh","2");
I find the result very annoying. There must be a better way.
Will I have to use Applet to Servlet or RMI instead?
Here is the entire servlet(there is another one also)

[This message has been edited by Randall Twede (edited March 04, 2001).]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13077
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That sure looks clumsy and annoying.
There are lots of different ways to do a chat system, I have a couple of simple ones in my servlets & JSP book.
For a pure HTML / servlet solution, I had the servlet create a page with two text areas, one to display the current state of the chat buffer and one for the user to type in new lines. A set of form buttons let the user simply refresh the chat display if he didn't want to send any text, or send text. That way the user is in control of when the page is regenerated.
Bill

------------------
author of:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic