%@ page language="java" import ="java.util.*" import="java.math.*" %>
TicTacToe
TicTacToe with JavaBean
<% // Check for a "Reset" button click
if (request.getParameter("reset") != null) {
game.reset();
}
%>
<% // Check for a game button click
for (int r=0; r<3; r++) {
for (int c=0; c<3; c++) {
if (request.getParameter("B" + r + c) != null) {
game.handleClick(r, c);
}
}
}
%>