diff --git a/MavenBack/src/main/java/ppp/staticServe/MainServe.java b/MavenBack/src/main/java/ppp/staticServe/MainServe.java index 31bbe5d..e4b2157 100644 --- a/MavenBack/src/main/java/ppp/staticServe/MainServe.java +++ b/MavenBack/src/main/java/ppp/staticServe/MainServe.java @@ -7,6 +7,7 @@ import jakarta.servlet.http.HttpServlet; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; @WebServlet("") // Disable until future need public class MainServe extends HttpServlet { @@ -15,11 +16,22 @@ public class MainServe extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { try { - - RequestDispatcher view = request.getRequestDispatcher("/index.html"); // The static HTML file to serve. - response.setHeader("Cache-Control", "max-age=86400, public"); // 1 day - System.out.println(view.toString()); - view.forward(request, response); + if (request.getSession().getAttribute("new") == null && request.getSession().getAttribute("email") == null) { + // Freshly created. + RequestDispatcher view = request.getRequestDispatcher("/home.html"); // The static HTML file to serve. + response.setHeader("Cache-Control", "no-store, must-revalidate"); + response.setHeader("Pragma", "no-cache"); + response.setHeader("Expires", "0"); + System.out.println(view.toString()); + view.forward(request, response); + } else { + // Already created. + RequestDispatcher view = request.getRequestDispatcher("/index.html"); // The static HTML file to serve. + response.setHeader("Cache-Control", "max-age=86400, public"); // 1 day + System.out.println(view.toString()); + view.forward(request, response); + } + request.getSession().setAttribute("new", false); return; } catch (Exception e) { diff --git a/MavenBack/src/main/webapp/baseStyle.css b/MavenBack/src/main/webapp/baseStyle.css index 578d6d9..1adb841 100644 --- a/MavenBack/src/main/webapp/baseStyle.css +++ b/MavenBack/src/main/webapp/baseStyle.css @@ -48,7 +48,8 @@ p, h1, th, td {color: white;} .navBar{ overflow: hidden; - background-color: #5A5A5A; + /*background-color: #5A5A5A;*/ + background-color: #333335; width: 100%; } .navBar a{ @@ -61,7 +62,6 @@ p, h1, th, td {color: white;} } .navBar a.left{float:left;} .navBar a:hover{ - /*background-color: #7fa751;*/ background-color: #8c463d; } diff --git a/MavenBack/src/main/webapp/home.html b/MavenBack/src/main/webapp/home.html index a6a1619..221c6ef 100644 --- a/MavenBack/src/main/webapp/home.html +++ b/MavenBack/src/main/webapp/home.html @@ -24,18 +24,17 @@ --> - - + +