@Override
    protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
            throws ServletException, IOException {
        final String pathInfo = request.getPathInfo();
        if (StringUtils.isEmpty(pathInfo)) {
            response.sendRedirect("view");
        } else if (GAME_JOIN.matcher(pathInfo).matches()) {
            final int gameId = Integer.parseInt(pathInfo.substring(6));
            final Game game = serverStatus.getGame(gameId);
            if (game != null && !game.isStarted()) {
                response.setContentType("text/html");
                response.getWriter().print(GAME_JOIN_FORM);
            } else {
                response.setContentType("text/html");
                response.getWriter().print(REDIRECT_HOME);
            }
        } else if (GAME_PLAY.matcher(pathInfo).matches()) {
            String[] params = pathInfo.split("/");
            final int gameId = Integer.parseInt(params[2]);
            final String usrName = params[4];
            final Game game = serverStatus.getGame(gameId);
            if (game != null) {
                if (game.containsPlayer(usrName)) {
                    response.setContentType("text/html");
                    response.getWriter().print(GAME_PLAY_PAGE);
                } else {
                    response.setContentType("text/html");
                    response.getWriter().print(REDIRECT_GAME);
                }
            } else {
                response.setContentType("text/html");
                response.getWriter().print(REDIRECT_HOME);
            }
        } else {
            response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
        }
    }