CMSC 10200: Lab 3

Wednesday, July 6, 2005

<-- back


This week's exercise: implementation of Tic-Tac-Toe, a "stateful" JSP webapp, by means of hidden fields.

Part 1

Finish implementing the TicTacToeBoard interface.

Part 2

Design an HTML page ttt.html. This page should include a form which allows the user to indicate the player whose move it is and the square to which the player would like to move. It should also contain a text field with the marshalled equivalent of an empty board.

Part 3

Design a JSP page ttt.jsp to "catch" the values from the form on the previous page. This page should construct a new TicTacToeBoard given the marshalled information. Then it should generate a new board based on the player's desired move. Then it should display that new board in HTML.

The page ttt.jsp should also contain a copy of the form that appeared on ttt.html for subsequent moves.

Part 4

Hide the fields containing the marshalling information.

Part 5

By this point you should have a tic-tac-toe game that two people can play. Put the finishing touches on it by making the JSP page display messages for victories and cat's games. Include a link from ttt.jsp back to ttt.html for players to start fresh games if they like.