From 01f9ceb9c298e214141247562be3081d6a3d3b19 Mon Sep 17 00:00:00 2001 From: cyb3r4nt <104218001+cyb3r4nt@users.noreply.github.com> Date: Fri, 24 Oct 2025 00:56:55 +0300 Subject: [PATCH] Add another handler method into JsonServiceExporter with jakarta request and response objects Newer Spring Framework uses jakarta.servlet.http.HttpServletRequest and jakarta.servlet.http.HttpServletResponse objects from the jakarta.* namespace. If JsonRpcServer is registered with @AutoJsonRpcServiceImpl in newer Spring Framework, then request fail due to missing method in a web handler. Newer org.springframework.web.HttpRequestHandler has a signature with jakarta objects, and if JsonServiceExporter has a method with same signature, then it can work with newer Spring MVC. --- .../jsonrpc4j/spring/JsonServiceExporter.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/com/googlecode/jsonrpc4j/spring/JsonServiceExporter.java b/src/main/java/com/googlecode/jsonrpc4j/spring/JsonServiceExporter.java index e43cd1a..119faea 100644 --- a/src/main/java/com/googlecode/jsonrpc4j/spring/JsonServiceExporter.java +++ b/src/main/java/com/googlecode/jsonrpc4j/spring/JsonServiceExporter.java @@ -31,4 +31,15 @@ public void handleRequest(HttpServletRequest request, HttpServletResponse respon response.getOutputStream().flush(); } + /** + * {@inheritDoc} + */ + public void handleRequest( + jakarta.servlet.http.HttpServletRequest request, + jakarta.servlet.http.HttpServletResponse response + ) throws ServletException, IOException { + jsonRpcServer.handle(request, response); + response.getOutputStream().flush(); + } + }