From 16f6c5ae15ec20b372e901b164f65a2701195297 Mon Sep 17 00:00:00 2001 From: panuozzo77 Date: Fri, 19 Jan 2024 10:07:12 +0100 Subject: [PATCH] added @Override in doGET|POST where missing --- src/main/java/controller/AddRemovePatientCondition.java | 4 ++-- src/main/java/controller/ChangePassword.java | 1 + src/main/java/controller/ChangeUserInfo.java | 2 ++ src/main/java/controller/CheckCurrentPassword.java | 1 + src/main/java/controller/ExerciseController.java | 1 + src/main/java/controller/ExerciseEvaluator.java | 1 + src/main/java/controller/ExerciseLogger.java | 1 + src/main/java/controller/GetSendMessages.java | 2 ++ src/main/java/controller/InvitePatient.java | 2 +- src/main/java/controller/Login.java | 2 +- src/main/java/controller/Logout.java | 1 + src/main/java/controller/ManageAIExercise.java | 1 + src/main/java/controller/Registration.java | 2 ++ src/main/java/controller/ResetPassword.java | 1 + src/main/java/controller/ScheduleManager.java | 1 + src/main/java/controller/SendResetPin.java | 1 + src/main/java/controller/exerciseRecommendation.java | 2 +- 17 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/main/java/controller/AddRemovePatientCondition.java b/src/main/java/controller/AddRemovePatientCondition.java index f8675f9..2288092 100644 --- a/src/main/java/controller/AddRemovePatientCondition.java +++ b/src/main/java/controller/AddRemovePatientCondition.java @@ -11,7 +11,8 @@ @WebServlet("/AddRemovePatientCondition") public class AddRemovePatientCondition extends HttpServlet { -//mammt + + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { String referer = request.getHeader("Referer"); ConditionManager conditionService= new ConditionManager(); @@ -33,5 +34,4 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) response.sendRedirect(referer); } - } diff --git a/src/main/java/controller/ChangePassword.java b/src/main/java/controller/ChangePassword.java index 2678cce..5ff49b0 100644 --- a/src/main/java/controller/ChangePassword.java +++ b/src/main/java/controller/ChangePassword.java @@ -13,6 +13,7 @@ @WebServlet("/ChangePassword") public class ChangePassword extends HttpServlet { + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String password = request.getParameter("password"); diff --git a/src/main/java/controller/ChangeUserInfo.java b/src/main/java/controller/ChangeUserInfo.java index e76fa9d..d6d60fd 100644 --- a/src/main/java/controller/ChangeUserInfo.java +++ b/src/main/java/controller/ChangeUserInfo.java @@ -13,6 +13,7 @@ @WebServlet("/changeDate") public class ChangeUserInfo extends HttpServlet { + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(); int userId = (int) session.getAttribute("id"); @@ -26,6 +27,7 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) response.sendRedirect("JSP/userArea.jsp?errorMessage=" + risultato); } + private boolean updatePersonalInfo(HttpServletRequest request, int userId, UserRegistry userRegistry) { String firstName = request.getParameter("firstname"); String lastName = request.getParameter("lastname"); diff --git a/src/main/java/controller/CheckCurrentPassword.java b/src/main/java/controller/CheckCurrentPassword.java index b6cc62a..50a440c 100644 --- a/src/main/java/controller/CheckCurrentPassword.java +++ b/src/main/java/controller/CheckCurrentPassword.java @@ -13,6 +13,7 @@ @WebServlet("/ControllPassword") public class CheckCurrentPassword extends HttpServlet { + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String password = request.getParameter("password"); diff --git a/src/main/java/controller/ExerciseController.java b/src/main/java/controller/ExerciseController.java index eaa2226..bfc334d 100644 --- a/src/main/java/controller/ExerciseController.java +++ b/src/main/java/controller/ExerciseController.java @@ -13,6 +13,7 @@ @WebServlet("/exerciseController") public class ExerciseController extends HttpServlet { + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { ExerciseManager em = new ExerciseManager(); String id = request.getParameter("exerciseID"); diff --git a/src/main/java/controller/ExerciseEvaluator.java b/src/main/java/controller/ExerciseEvaluator.java index 6b72484..d8c64d0 100644 --- a/src/main/java/controller/ExerciseEvaluator.java +++ b/src/main/java/controller/ExerciseEvaluator.java @@ -32,6 +32,7 @@ @WebServlet("/exerciseEvaluator") @MultipartConfig public class ExerciseEvaluator extends HttpServlet { + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession s = request.getSession(); String contentType = request.getContentType(); diff --git a/src/main/java/controller/ExerciseLogger.java b/src/main/java/controller/ExerciseLogger.java index 9f3aa30..358d4f1 100644 --- a/src/main/java/controller/ExerciseLogger.java +++ b/src/main/java/controller/ExerciseLogger.java @@ -22,6 +22,7 @@ maxFileSize=1024*1024*50, // 50 MB maxRequestSize=1024*1024*100) // 100 MB public class ExerciseLogger extends HttpServlet { + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String contentType = request.getContentType(); if ("application/json".equals(contentType)) { diff --git a/src/main/java/controller/GetSendMessages.java b/src/main/java/controller/GetSendMessages.java index 0b064fe..af1425d 100644 --- a/src/main/java/controller/GetSendMessages.java +++ b/src/main/java/controller/GetSendMessages.java @@ -18,6 +18,7 @@ @WebServlet("/GetMessages") public class GetSendMessages extends HttpServlet { + @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { HttpSession session = request.getSession(); int userId = (int) session.getAttribute("id"); @@ -52,6 +53,7 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t response.getWriter().write(jsonArray.toString()); } + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { try { diff --git a/src/main/java/controller/InvitePatient.java b/src/main/java/controller/InvitePatient.java index e452696..6527a6c 100644 --- a/src/main/java/controller/InvitePatient.java +++ b/src/main/java/controller/InvitePatient.java @@ -12,7 +12,7 @@ @WebServlet("/invitePatient") public class InvitePatient extends HttpServlet { - + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { HttpSession session = request.getSession(); model.service.registration.Registration registration=new Registration(); diff --git a/src/main/java/controller/Login.java b/src/main/java/controller/Login.java index a3213bb..938e72f 100644 --- a/src/main/java/controller/Login.java +++ b/src/main/java/controller/Login.java @@ -25,7 +25,7 @@ public void init() { this.userData = new UserData(); this.userReg = new UserRegistry(); } - + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { diff --git a/src/main/java/controller/Logout.java b/src/main/java/controller/Logout.java index 2c0daa6..7da1ab4 100644 --- a/src/main/java/controller/Logout.java +++ b/src/main/java/controller/Logout.java @@ -10,6 +10,7 @@ @WebServlet("/logout") public class Logout extends HttpServlet { + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { HttpSession session = request.getSession(false); if (session != null) { diff --git a/src/main/java/controller/ManageAIExercise.java b/src/main/java/controller/ManageAIExercise.java index 3d77889..94d841a 100644 --- a/src/main/java/controller/ManageAIExercise.java +++ b/src/main/java/controller/ManageAIExercise.java @@ -14,6 +14,7 @@ @WebServlet("/ManageExercise") public class ManageAIExercise extends HttpServlet { + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{ String referer = request.getHeader("Referer"); String action = request.getParameter("action"); diff --git a/src/main/java/controller/Registration.java b/src/main/java/controller/Registration.java index 84d102f..1128d01 100644 --- a/src/main/java/controller/Registration.java +++ b/src/main/java/controller/Registration.java @@ -15,6 +15,7 @@ @WebServlet("/register") public class Registration extends HttpServlet { + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { response.setContentType("text/html"); @@ -47,6 +48,7 @@ private void sessionAttributesForTesting(HttpServletRequest request) { session.setAttribute("surname", "Selenium"); } + @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { UserData ud = new UserData(); HttpSession session = request.getSession(); diff --git a/src/main/java/controller/ResetPassword.java b/src/main/java/controller/ResetPassword.java index dee3562..3be2f27 100644 --- a/src/main/java/controller/ResetPassword.java +++ b/src/main/java/controller/ResetPassword.java @@ -11,6 +11,7 @@ @WebServlet("/login/resetpassword") public class ResetPassword extends HttpServlet { + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { diff --git a/src/main/java/controller/ScheduleManager.java b/src/main/java/controller/ScheduleManager.java index 0a8760b..bab3433 100644 --- a/src/main/java/controller/ScheduleManager.java +++ b/src/main/java/controller/ScheduleManager.java @@ -8,6 +8,7 @@ @WebServlet("/ScheduleServlet") public class ScheduleManager extends HttpServlet { + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { int userId = (Integer) request.getSession().getAttribute("id"); response.getWriter().append("Served at: ").append(request.getContextPath()); diff --git a/src/main/java/controller/SendResetPin.java b/src/main/java/controller/SendResetPin.java index 011eedb..992e681 100644 --- a/src/main/java/controller/SendResetPin.java +++ b/src/main/java/controller/SendResetPin.java @@ -11,6 +11,7 @@ @WebServlet("/login/reset") public class SendResetPin extends HttpServlet { + @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { String email = request.getParameter("email"); UserData checker = new UserData(); diff --git a/src/main/java/controller/exerciseRecommendation.java b/src/main/java/controller/exerciseRecommendation.java index 46a4084..a29cb37 100644 --- a/src/main/java/controller/exerciseRecommendation.java +++ b/src/main/java/controller/exerciseRecommendation.java @@ -12,7 +12,7 @@ @WebServlet("/exerciseRecommendation") public class exerciseRecommendation extends HttpServlet { - + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { String referer = request.getHeader("Referer"); ExerciseManager exerciseService= new ExerciseManager();