Java EE Connect Four Game Exam Guide
Java EE Connect Four Game Exam Guide
2011 – 2012
Examination conditions:
• All documents are allowed except the Internet.
• The assignment is done on a machine and will be submitted on a USB stick provided by the examiners.
Important Note: You must implement the following website in JEE. The file you need to
render is an WAR containing the entire site AS WELL AS THE Java SOURCES. Any other type of
Submitting (Eclipse project zip, file zip, ...) will automatically result in a zero grade.
Connect Four
The purpose of this exercise is to create a site allowing a user to play the game of Connect Four.
Unlike a classic online Connect Four game (Java Applet or JavaScript code), here we want
that the treatments are done on the server side, so every time the player wants to play, a
The request will be sent to the server, which will return the modified page.
Functional requirements:
• It is more important to have a functional site, even with fewer features, than ...
trying to do everything but nothing works (for example, program the AI last,
do not necessarily handle all input errors right from the start, etc...).
• The size of the grid must be parameterizable. Thus, if the bean storing the grid does not exist, you
ask the user to enter the size of the grid in order to generate it.
• Every time you play, the AI must also play; you can assume it is playing.
randomly (be careful to handle the case of full columns).
• The management of victory/defeat is not the simplest, so it is not taken into account in
the grading scale, and is considered a bonus.
• You need to create 2 servlets:
• A servlet called in POST by the URL "/Create", generating the grid
• Another one called in GET by the url "/Play", when the player plays on a column
• The controller must handle potential input errors from the form: column out of bounds
limits, non-integer column, play on a full column, ...
CSS Annex
• CSS: To change the text color:
color: red;
• CSS: To set a background image (for example, on a box):
url('images/[Link]')
• CSS: To change the size of a box
width:69px;
69px
Attention: empty cells do not resize by default, you must add at least
a non-breaking space ( ) in the <td>.
Ex :
<td class="emptyCell"> </td>
• CSS: To center text relative to a table cell or other element:
text-align:center;
• CSS: To center a <table> or a <p>, use:
margin:auto;