my dog learned polymorphism*
The moose likes Servlets and the fly likes servlet-applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet-applet" Watch "servlet-applet" New topic
Author

servlet-applet

priya _raghu
Greenhorn

Joined: Feb 01, 2004
Posts: 4
Hello everybody,
My doubt is in servlets.
I have done intranet chat app using socket connection.I want to convert into
servlets.I am not familiar with servlets.so, i need a basic idea abt this.
My application is like..
one server multiple clients.like one to many.
for eg: server, client1, client2, client3...
it wroks like this.. client1 comunicate to server same as client2 and 3.
there is no client to client communication.
i wanted to do it servlets.I have used applets.
so for each client connection i create a separate threads.
how the architecture should be ?
help me pls...
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Well, since you don't have experience with Servlets, then maybe you should start out with an easier application. Like create a hello world Servlet. Then the next Servlet have it return a table of data.
I also don't really see Servlets as a good choice for a chat program. My opinion of course.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

"Priya priya"-
Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it
here.
Thanks! and welcome to the JavaRanch!
Mark
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12756
    
    5
wanted to do it servlets.I have used applets.
so for each client connection i create a separate threads.

Well, thats the first big change you have to make - in a servlet architecture, the servlet container calls your servlet with a request from a client. Your job is to figure out which client sent it and create a response. You let the servlet container handle all the Threads and connections.
Like Mark says - you better start with something simpler.
Actually, a combination of servlet and applet makes a pretty good chat system - I have used a commercial chat that worked that way.
My Servlets and JSP book (now out of print I think) used a chat servlet as an example - with HTML forms, not applets on the client side.
Bill
priya _raghu
Greenhorn

Joined: Feb 01, 2004
Posts: 4
Thanx for you kind suggestions.
But i am confident i can start writing servlets.
But i want to know the exact logic..
whether to have two servlets for server and client.
or one servlet how to proceed abt.
Thanx.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12756
    
    5
You the programmer will have to invent the exact logic - thats what programming is all about. Sit down with a pencil and pad of paper - preferably far from the computer so you won't be tempted to start writing code too soon.
Write out the various sequences of events that could possibly happen to users on your chat system - without using any specific details. Once you have a pretty complete list of the various events start diagramming the entities and the flow of data. Don't be afraid to throw away one or more preliminary designs.
Bill
priya _raghu
Greenhorn

Joined: Feb 01, 2004
Posts: 4
Thanx sir i will try.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet-applet
 
Similar Threads
how to work with socket
executing a java program from web client
how to work with socket
Sending data from client to Server
executing a java program from web client