Q:

ArrayIndexOutOfBoundsException in Tomcat Server HTML page Tic-Tac-Toe

When I try to run my Tomcat server and input the bottom most, right most value in the Tic-Tac-Toe grid, I keep getting this error:
java.lang.ArrayIndexOutOfBoundsException: 9
    vejus.satya.tictactoe.Servlet.doGet(Servlet.java:33)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
  org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Here is my HTML code inside my form:
  <tr>
    <td><input type="radio" name="input" value="0"> </td>
    <td><input type="radio" name="input" value="1"> </td>
    <td><input type="radio" name="input" value="2"> </td>
  </tr>
  <tr>
    <td><input type="radio" name="input" value="3"> </td>
    <td><input type="radio" name="input" value="4"> </td>
    <td><input type="radio" name="input" value="5"> </td>
  </tr>
  <tr>
    <td><input type="radio" name="input" value="6"> </td>
    <td><input type="radio" name="input" value="7"> </td>
    <td><input type="radio" name="input" value="8"> </td>
  </tr>

Here is my Java code that takes this:
String[] board = new String[9];
for (int i = 0; i < 9; i ++) {
    board[i] = "<input type=\"radio\" name=\"input\" value=\"" + i + "\">";
}

int loc = Integer.parseInt(req.getParameter("input"));
board[loc] = "X";

How do I fix this? The input I get is 9 while I made it 8 in the HTML code as you can see above, so I don't know why my input value is not working. This is why I get this error.

A:

Ok it works now. All I did was remove the project from the server and then add it again, and then run the server. Simple refresh resolution

