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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.


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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Application launch issue with Apache Tomcat 5 45
simple java question 3 56
how to add new optional parameter to JSP 1 43
even odd program using while loop 3 44
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…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

825 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