data = field.getFieldData();
+
+ // Обновляем этот список в сессии
+ currentSession.setAttribute("data", data);
+
+ // Шлем редирект
+ response.sendRedirect("/index.jsp");
+ return true;
+ }
+ return false;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/tictactoe/RestartServlet.java b/src/main/java/com/tictactoe/RestartServlet.java
new file mode 100644
index 00000000..3ebfb6fe
--- /dev/null
+++ b/src/main/java/com/tictactoe/RestartServlet.java
@@ -0,0 +1,16 @@
+package com.tictactoe;
+
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+@WebServlet(name = "RestartServlet", value = "/restart")
+public class RestartServlet extends HttpServlet {
+ @Override
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
+ req.getSession().invalidate();
+ resp.sendRedirect("/start");
+ }
+}
\ No newline at end of file
diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp
index 964cc071..48ac1e0f 100644
--- a/src/main/webapp/index.jsp
+++ b/src/main/webapp/index.jsp
@@ -1,16 +1,62 @@
+<%@ page import="com.tictactoe.Sign" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+
+ ">
Tic-Tac-Toe
Tic-Tac-Toe
+
+
+ | ${data.get(0).getSign()} |
+ ${data.get(1).getSign()} |
+ ${data.get(2).getSign()} |
+
+
+ | ${data.get(3).getSign()} |
+ ${data.get(4).getSign()} |
+ ${data.get(5).getSign()} |
+
+
+ | ${data.get(6).getSign()} |
+ ${data.get(7).getSign()} |
+ ${data.get(8).getSign()} |
+
+
+
+
-
+
+
+ CROSSES WIN!
+
+
+
+ NOUGHTS WIN!
+
+
+
+ IT'S A DRAW
+
+
+
+
diff --git a/src/main/webapp/static/main.css b/src/main/webapp/static/main.css
index e69de29b..4ea58a46 100644
--- a/src/main/webapp/static/main.css
+++ b/src/main/webapp/static/main.css
@@ -0,0 +1,180 @@
+body {
+ background-color: #383838;
+}
+
+h1 {
+ font-family: "Arial Black";
+ color: white;
+
+}
+
+table {
+
+ margin-left: auto;
+ margin-right: auto;
+ background-color: #ec6b14;
+ border-radius: 14px;
+ border-collapse: collapse;
+
+}
+
+
+
+td {
+ font-family: "Arial Black";
+ color: white;
+ border-spacing: 40px;
+ border: 5px solid #383838;
+ padding: 14px;
+ margin: 14px;
+ width: 150px;
+ height: 150px;
+ font-size: 50px;
+ text-align: center;
+ empty-cells: show;
+}
+
+tr:first-child td {
+ border-top: none;
+}
+
+tr:last-child td {
+ border-bottom: none;
+}
+
+tr td:first-child {
+ border-left: none;
+}
+
+tr td:last-child {
+ border-right: none;
+}
+
+
+.bottom-fixed {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ padding: 20px;
+ text-align: center;
+}
+
+.btn-new {
+ text-align: center;
+ font-family: "Arial Black";
+ border: none;
+ padding: 12px 18px;
+ transition: 0.5s;
+ font-size: 30px;
+ background-size: 300% auto;
+ color: white;
+ border-radius: 6px;
+ background-image: linear-gradient(to right, #003CC5 0%, #0B63F6 51%, #003CC5 100%);
+ opacity: 0;
+ animation: fadeInAnimation 1s ease-in forwards;
+}
+
+@keyframes fadeInAnimation {
+ from {
+ opacity: 0;
+ }
+ to {
+ opacity: 1;
+ }
+}
+
+.btn-new:hover {
+ background-position: right center;
+}
+
+body {
+ background-color: #383838;
+}
+
+h1 {
+ font-family: "Arial Black";
+ color: white;
+
+}
+
+table {
+
+ margin-left: auto;
+ margin-right: auto;
+ background-color: #ec6b14;
+ border-radius: 14px;
+ border-collapse: collapse;
+
+}
+
+
+
+td {
+ font-family: "Arial Black";
+ color: white;
+ border-spacing: 40px;
+ border: 5px solid #383838;
+ padding: 14px;
+ margin: 14px;
+ width: 150px;
+ height: 150px;
+ font-size: 50px;
+ text-align: center;
+ empty-cells: show;
+}
+
+tr:first-child td {
+ border-top: none;
+}
+
+tr:last-child td {
+ border-bottom: none;
+}
+
+tr td:first-child {
+ border-left: none;
+}
+
+tr td:last-child {
+ border-right: none;
+}
+
+
+.bottom-fixed {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ padding: 20px;
+ text-align: center;
+}
+
+.btn-new {
+ text-align: center;
+ font-family: "Arial Black";
+ border: none;
+ padding: 12px 18px;
+ transition: 0.5s;
+ font-size: 30px;
+ background-size: 300% auto;
+ color: white;
+ border-radius: 6px;
+ background-image: linear-gradient(to right, #003CC5 0%, #0B63F6 51%, #003CC5 100%);
+ opacity: 0;
+ animation: fadeInAnimation 1s ease-in forwards;
+}
+
+@keyframes fadeInAnimation {
+ from {
+ opacity: 0;
+ }
+ to {
+ opacity: 1;
+ }
+}
+
+.btn-new:hover {
+ background-position: right center;
+}
+