Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Applet - Servlet Comm.  RSS feed

 
Savio Mascarenhas
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guy's !!!
I am presently workin on the development of a Chat System.
I am trying to use an applet-servlet comm.I was just wondering ... whether i would have to create a servlet for every Chat Room.How should it be ?
Thanx.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A single servlet can certainly handle any number of "rooms", you just need to ensure that every request to the servlet has a parameter indicating which "room" it belongs to.
You can do this with cookies or with hidden form parameters. There is an example in my servlets book and probably other servlets books as this is a common example application.
Bill

------------------
author of:
 
Cameron Park
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just an addendum, if you are using an applet as a chat client, i is probaly better to make it a TCP/IP connection instead of regular HTTP. That means you can hav better flexibility in the server side design(you don't necessarily have to use servlet to run the chat).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!