From 0b2d61d2cbe6f43f0e66561f31323ce864938743 Mon Sep 17 00:00:00 2001 From: surjendu104 Date: Mon, 1 Apr 2024 20:42:08 +0530 Subject: [PATCH 1/4] chore : upgrade the jackson-databind to latest version(2.17.0) --- dynamic-proxy/pom.xml | 7 ++++++- event-sourcing/pom.xml | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dynamic-proxy/pom.xml b/dynamic-proxy/pom.xml index 0ec69f0bcc6e..d308c7885993 100644 --- a/dynamic-proxy/pom.xml +++ b/dynamic-proxy/pom.xml @@ -35,10 +35,15 @@ dynamic-proxy + + com.fasterxml.jackson.core + jackson-core + 2.17.0 + com.fasterxml.jackson.core jackson-databind - 2.16.1 + 2.17.0 org.springframework diff --git a/event-sourcing/pom.xml b/event-sourcing/pom.xml index 569a5fceebd8..19f6feb8f7a7 100644 --- a/event-sourcing/pom.xml +++ b/event-sourcing/pom.xml @@ -39,9 +39,15 @@ junit-jupiter-engine test + + com.fasterxml.jackson.core + jackson-core + 2.17.0 + com.fasterxml.jackson.core jackson-databind + 2.17.0 From 510b47d4bbea22ec8a99f2e1de58e48569703274 Mon Sep 17 00:00:00 2001 From: surjendu104 Date: Mon, 1 Apr 2024 21:16:03 +0530 Subject: [PATCH 2/4] refactor: refactor Composite View --- .../iluwatar/compositeview/AppServlet.java | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/composite-view/src/main/java/com/iluwatar/compositeview/AppServlet.java b/composite-view/src/main/java/com/iluwatar/compositeview/AppServlet.java index 0cef25d2dd22..bd9cbd3bee15 100644 --- a/composite-view/src/main/java/com/iluwatar/compositeview/AppServlet.java +++ b/composite-view/src/main/java/com/iluwatar/compositeview/AppServlet.java @@ -29,6 +29,7 @@ import jakarta.servlet.http.HttpServlet; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; +import lombok.extern.slf4j.Slf4j; import java.io.IOException; import java.io.PrintWriter; @@ -36,7 +37,7 @@ * A servlet object that extends HttpServlet. * Runs on Tomcat 10 and handles Http requests */ - +@Slf4j public final class AppServlet extends HttpServlet { private static final String CONTENT_TYPE = "text/html"; private String msgPartOne = "

This Server Doesn't Support"; @@ -56,39 +57,44 @@ public AppServlet() { } @Override - public void doGet(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - RequestDispatcher requestDispatcher = req.getRequestDispatcher(destination); - ClientPropertiesBean reqParams = new ClientPropertiesBean(req); - req.setAttribute("properties", reqParams); - requestDispatcher.forward(req, resp); + public void doGet(HttpServletRequest req, HttpServletResponse resp) { + try { + RequestDispatcher requestDispatcher = req.getRequestDispatcher(destination); + ClientPropertiesBean reqParams = new ClientPropertiesBean(req); + req.setAttribute("properties", reqParams); + requestDispatcher.forward(req, resp); + } catch (Exception e) { + LOGGER.error("Exception occurred GET request processing ", e); + } } @Override - public void doPost(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { + public void doPost(HttpServletRequest req, HttpServletResponse resp) { resp.setContentType(CONTENT_TYPE); try (PrintWriter out = resp.getWriter()) { out.println(msgPartOne + " Post " + msgPartTwo); + } catch (Exception e) { + LOGGER.error("Exception occurred POST request processing ", e); } - } @Override - public void doDelete(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { + public void doDelete(HttpServletRequest req, HttpServletResponse resp) { resp.setContentType(CONTENT_TYPE); try (PrintWriter out = resp.getWriter()) { out.println(msgPartOne + " Delete " + msgPartTwo); + } catch (Exception e) { + LOGGER.error("Exception occurred DELETE request processing ", e); } } @Override - public void doPut(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { + public void doPut(HttpServletRequest req, HttpServletResponse resp) { resp.setContentType(CONTENT_TYPE); try (PrintWriter out = resp.getWriter()) { out.println(msgPartOne + " Put " + msgPartTwo); + } catch (Exception e) { + LOGGER.error("Exception occurred PUT request processing ", e); } } } From 36d36fd59271b0d415d1ae063092ea74b42b1b4b Mon Sep 17 00:00:00 2001 From: surjendu104 Date: Mon, 1 Apr 2024 21:26:27 +0530 Subject: [PATCH 3/4] refactor: remove unnecessary chnges related to this PR(#2853) --- dynamic-proxy/pom.xml | 7 +------ event-sourcing/pom.xml | 6 ------ 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/dynamic-proxy/pom.xml b/dynamic-proxy/pom.xml index d308c7885993..0ec69f0bcc6e 100644 --- a/dynamic-proxy/pom.xml +++ b/dynamic-proxy/pom.xml @@ -35,15 +35,10 @@ dynamic-proxy - - com.fasterxml.jackson.core - jackson-core - 2.17.0 - com.fasterxml.jackson.core jackson-databind - 2.17.0 + 2.16.1 org.springframework diff --git a/event-sourcing/pom.xml b/event-sourcing/pom.xml index 19f6feb8f7a7..569a5fceebd8 100644 --- a/event-sourcing/pom.xml +++ b/event-sourcing/pom.xml @@ -39,15 +39,9 @@ junit-jupiter-engine test - - com.fasterxml.jackson.core - jackson-core - 2.17.0 - com.fasterxml.jackson.core jackson-databind - 2.17.0 From 67ceb6b43ead675a0b19c19214a6e3afa50759ff Mon Sep 17 00:00:00 2001 From: surjendu104 Date: Mon, 1 Apr 2024 21:45:25 +0530 Subject: [PATCH 4/4] fix: checkstyle error in AppServlet.java --- .../src/main/java/com/iluwatar/compositeview/AppServlet.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/composite-view/src/main/java/com/iluwatar/compositeview/AppServlet.java b/composite-view/src/main/java/com/iluwatar/compositeview/AppServlet.java index bd9cbd3bee15..d2ec90675eb5 100644 --- a/composite-view/src/main/java/com/iluwatar/compositeview/AppServlet.java +++ b/composite-view/src/main/java/com/iluwatar/compositeview/AppServlet.java @@ -25,13 +25,11 @@ package com.iluwatar.compositeview; import jakarta.servlet.RequestDispatcher; -import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServlet; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; -import lombok.extern.slf4j.Slf4j; -import java.io.IOException; import java.io.PrintWriter; +import lombok.extern.slf4j.Slf4j; /** * A servlet object that extends HttpServlet.