@@ -0,0 +1,1274 @@
+package com.google.research.bleth.servlets;%0A%0Aimport com.google.research.bleth.simulator.BoardState;%0A%0Aimport java.io.IOException;%0Aimport javax.servlet.annotation.WebServlet;%0Aimport javax.servlet.http.HttpServlet;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0A/** A servlet used for reading a board state from the db and write it to response as a JSON 2D array. */%0A@WebServlet(%22/read-board-state%22)%0Apublic class ReadBoardStateServlet extends HttpServlet %7B%0A%0A    @Override%0A    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException %7B%0A%0A        // Get board state parameters.%0A        int round = Integer.parseInt(request.getParameter(%22round%22));%0A        String simulationId = request.getParameter(%22simulationId%22);%0A        boolean isReal = Boolean.parseBoolean(request.getParameter(%22isReal%22));%0A%0A        // Read board state.%0A        BoardState boardState;%0A        if (isReal) %7B%0A            boardState = BoardState.readReal(simulationId, round);%0A        %7D else %7B%0A            boardState = BoardState.readEstimated(simulationId, round);%0A        %7D%0A%0A        // Write to response.%0A        response.setContentType(%22application/json;%22);%0A        response.getWriter().println(boardState.toJson());%0A    %7D%0A%7D%0A

add a servlet for reading a board state.