MIDTERM
CS320, Spring 2004


Upload your bean and JSP to the cs server and make sure they work there. Print a hard copy of your TTTBean.java and TicTacToe.jsp and turn it in at the end of the exam. Do not forget to put your name and your server account name on the hard copy.


[Problem Description] Tic Tac Toe is a game played on a 3 by 3 grid by two players, Player 1 and Player 2. Player 1 starts by placing an O at an unoccupied grid postition. Then Player 2 places an X at an unoccupied grid position. Play alternates between Player 1 and 2 until one player's symbols occupy an entire line (vertical, horizontal, or diagonal), in which case that player wins; or the grid is filled, in which case the game is tied.

For this exam you are going to implement the Tic Tac Toe game using JSP. The game will be played by two human players, so no AI code is needed. To receive any credit at all for the exam, your implementation must follow the following specifications:

[Bean] Your JSP must use a Java Bean called TTTBean to keep track the progress of the game. In particular, the bean must have the following properties:
Note that move and new are write-only properties, which mean your bean doesn't need to have getMove() or getNew() method, while status and board are read-only properties, which means your bean doesn't need to have setStatus() or setBoard() method.

[JSP]  You should have a JSP file called TicTacToe.jsp which displays the following:
Here's some sample display:


You should use only HTML, Java beans, JSTL tags, and Expression Language (EL) in your JSP file. Any scripting element in the JSP file will incur a 5pt penalty per statement with the maximum penalty of 40pt. Directives and comments do not count as scripting elements.

[Grading Criteria]

1. TTTBean.java
2. TicTacToe.jsp
3. JSP does not work on cs.calstatela.edu (-30pt)