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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users


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..


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

Create CentOS 7 Newton Packstack Running Keystone

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

624 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