Java Servlet and Applet

Posted on 2001-06-24
Last Modified: 2013-11-24
I am looking at creating a set of programs where people can play card games against each other online. This would be done via a web page where the game applet is loaded via a button. The button would then start the applet which would connect to the servlet. If the servlet is not up, the servlet would be started up.

The servlet basically acts as a referee and sends messages on what to display. The servlet would record results to a file on it's local computer.

The applets would display information and allow moves and commands to be processed.


1. Is this approach possible?
2. Is there any special considerations that i need to consider?
3. I would like as part of this solution, basic html code for the web page, base java applet code and servlet code.
4. Instructions on how to install whatever software is needed
5 Assistance in getting the base code up and running.

Question by:andrewmchorney

Accepted Solution

goldwarlock earned 200 total points
ID: 6223305
Approach is rather good
Use IE5.0> and JRun/JSDK2.0 on server side
HTML code and simple examples of code han be found on
Installation is simple and can be done by online/readme instructions

Author Comment

ID: 6223327
What should I do for netscape?

Author Comment

ID: 6223334
Can you point to examples of applet and servlet in

Expert Comment

ID: 6223404
All this for 200 points ?? Maybe with some bucks....

Expert Comment

ID: 6224543
too much assistance...well it is perfectly possible...
u need to take care of session the servlet..since the session management code of servlet does not gaurantee that u will be returned the same session when there is applet to servlet communication hence u need to pass a unique ID to all the applets so that they can take part in is all easy u really need the code..start some thing i can add to them later..

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!


Author Comment

ID: 6224621
I was just looking for a minimal applet, servlet and htlml code with assistance in setting up. I am not looking for the whole program.

Expert Comment

ID: 6227795
Hello andrewmchorney,

  It is easily possible.  For this all you have to do is, you should have a class which is shared by both the players.  I have already done this for another game.  What I will do in that is, the game object is common to both the players.  In the servlet, I have observer and observable classes which is used to intimate the other player when there is a move.  The server will intimate the other player when there is a change in the game object.  In the client side, there will be a thread which is listening for the servers response.  When it is your turn, all you have to do is, just submit to the server with the appropriate moves.

All the best


Author Comment

ID: 6229747

I am looking for a small applet that just connects to the servlet, a servlet that would respond to the request and some html code that would start up the servlet (if not running) and  the applet.

Expert Comment

ID: 6877307
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if still open in seven days.  Please post closing recommendations before that time.

Question(s) below appears to have been abandoned. Your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, please comment to advise the other participants why you wish to do this.

For special handling needs, please post a zero point question in the link below and include the question QID/link(s) that it regards.
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process.

Please click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, to track all your open and locked questions at this site.  If you are an EE Pro user, use the Power Search option to find them.  Anytime you have questions which are LOCKED with a Proposed Answer but does not serve your needs, please reject it and add comments as to why.  In addition, when you do grade the question, if the grade is less than an A, please add a comment as to why.  This helps all involved, as well as future persons who may access this item in the future to seek help.

To view your open questions, please click the following link(s) and keep them all current with updates.

To view your locked questions, please click the following link(s) and evaluate the proposed answer.

------------>  EXPERTS:  Please leave any comments regarding your closing recommendations if this item remains inactive another seven (7) days.  Also, if you are interested in the cleanup effort, please click this link

Moderators will finalize this question if still open in 7 days, by either moving this to the PAQ (Previously Asked Questions) at zero points, deleting it or awarding expert(s) when recommendations are made, or an independent determination can be made.  Expert input is always appreciated to determine the fair outcome.
Thank you everyone.
Moderator @ Experts Exchange

P.S.  For any year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.

Expert Comment

ID: 6973415
Force-accepted by
CS Moderator

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now