Skip to content

Commit

Permalink
Fix Stats navbar, all players on home page
Browse files Browse the repository at this point in the history
Stats static serve
  • Loading branch information
ALEEF02 committed Nov 18, 2022
1 parent 7d2941b commit f3a0f19
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
36 changes: 36 additions & 0 deletions MavenBack/src/main/java/ppp/staticServe/StatisticServe.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package ppp.staticServe;

import java.io.IOException;

import jakarta.servlet.RequestDispatcher;
/*import jakarta.servlet.ServletConfig;
import jakarta.servlet.ServletException;*/
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

@WebServlet("/stats")
public class StatisticServe extends HttpServlet {

@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException {

try {
RequestDispatcher view = request.getRequestDispatcher("/stats.html");

System.out.println(view.toString());
view.forward(request, response);
return;

} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
response.setStatus(500);
response.getWriter().print("{\"error\":\"" + e + "\"}");
return;

}
}
}
2 changes: 1 addition & 1 deletion MavenBack/src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
}
}
}
usersReq.open('GET', '/api/users?ranks=20&mRD=300&cached=1');
usersReq.open('GET', '/api/users?ranks=50&mRD=300&cached=1');
usersReq.send();
});
</script>
Expand Down
2 changes: 1 addition & 1 deletion MavenBack/src/main/webapp/stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
</head>
<body>
<div class = "navBar" role="navigation" aria-label="Main">
<a href = "https://www.youtube.com/watch?v=dQw4w9WgXcQ" class = "left">The Ping Pong Page</a>
<a href = "/" class = "left">Home</a>
<a id="userButton" href="/login">...</a> <!--Leads to user page to display user name, stats, etc.-->
<a href = "/games">Manage Your Games</a> <!--Leads to seprate page for ppl to register their games-->
</div>
Expand Down

0 comments on commit f3a0f19

Please sign in to comment.