From 796c6ba27d7e9baabb967769e69c15c76a8bd88a Mon Sep 17 00:00:00 2001 From: HliasMpGH Date: Thu, 29 Feb 2024 01:30:55 +0200 Subject: [PATCH] modify var names; add comments --- gui/src/main/java/gr/bibliotech/PropertyHandler.java | 12 ++++++------ .../web/HttpControllers/LoginController.java | 10 ++++------ .../web/HttpControllers/SearchController.java | 10 ---------- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/gui/src/main/java/gr/bibliotech/PropertyHandler.java b/gui/src/main/java/gr/bibliotech/PropertyHandler.java index ccc4d3d..7cd91f1 100644 --- a/gui/src/main/java/gr/bibliotech/PropertyHandler.java +++ b/gui/src/main/java/gr/bibliotech/PropertyHandler.java @@ -7,10 +7,10 @@ public class PropertyHandler { // the file of apps' configurations - private static String propFileName = "config.xml"; + private static String configFileName = "config.xml"; - // the apps' properties - private static Properties prop = new Properties(); + // the apps' configurations + private static Properties configs = new Properties(); // the ClassLoader of this class, used for accessing properties private static ClassLoader loader = PropertyHandler.class.getClassLoader(); @@ -19,9 +19,9 @@ public class PropertyHandler { // init config memory upon application boot up static { if (loader != null) { - try (InputStream config = loader.getResourceAsStream(propFileName)) { + try (InputStream config = loader.getResourceAsStream(configFileName)) { // load config file as a property - prop.loadFromXML(config); + configs.loadFromXML(config); } catch (IOException e) { System.out.println(e.getMessage()); } @@ -34,7 +34,7 @@ public class PropertyHandler { * @return the config file of the app as a property */ public static Properties getConfig() { - return prop; + return configs; } /** diff --git a/gui/src/main/java/gr/bibliotech/web/HttpControllers/LoginController.java b/gui/src/main/java/gr/bibliotech/web/HttpControllers/LoginController.java index 601ea03..672329d 100644 --- a/gui/src/main/java/gr/bibliotech/web/HttpControllers/LoginController.java +++ b/gui/src/main/java/gr/bibliotech/web/HttpControllers/LoginController.java @@ -36,9 +36,8 @@ public String showRegisterPage() { } /** - * Configures GET requests upon user search - * interaction. Presents results of the - * requests. + * Validates the info of a user + * when a login takes place */ @PostMapping("login/validate") public String showResults(@RequestParam("username") String username, @@ -62,9 +61,8 @@ public String showResults(@RequestParam("username") String username, } /** - * Configures GET requests upon user search - * interaction. Presents results of the - * requests. + * Validates the info of a user + * when a new registration takes place */ @PostMapping("register/validate") public String showResults(@RequestParam("username") String username, diff --git a/gui/src/main/java/gr/bibliotech/web/HttpControllers/SearchController.java b/gui/src/main/java/gr/bibliotech/web/HttpControllers/SearchController.java index 28e6ba7..56b5498 100644 --- a/gui/src/main/java/gr/bibliotech/web/HttpControllers/SearchController.java +++ b/gui/src/main/java/gr/bibliotech/web/HttpControllers/SearchController.java @@ -50,14 +50,4 @@ public String showResults(@RequestParam("query") String query, return "bookSearch.html"; } - - /** - * Configures GET requests upon user search - * interaction. Presents results of the - * requests. - */ - @GetMapping("/register") - public String showResults() { - return "register.html"; - } }