You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2024/06/18 08:04:16 UTC

(jena) branch main updated (2646c857e8 -> 4ecc87dab3)

This is an automated email from the ASF dual-hosted git repository.

andy pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git


    from 2646c857e8 GH-2487: add OntClass#canAs*Class methods + fix some mistakes
     new e63358c265 Bump jakarta.servlet:jakarta.servlet-api from 6.0.0 to 6.1.0
     new 4ecc87dab3 Update example for jakarta.servlet API 6.1

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/examples/ExFusekiMain_3_FusekiModule.java | 25 +++++++++++++---------
 .../apache/jena/test/conn/StringHolderServlet.java |  3 ++-
 pom.xml                                            |  2 +-
 3 files changed, 18 insertions(+), 12 deletions(-)


(jena) 01/02: Bump jakarta.servlet:jakarta.servlet-api from 6.0.0 to 6.1.0

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git

commit e63358c2654cf411dc27978aa08090d5a330bb48
Author: dependabot[bot] <49...@users.noreply.github.com>
AuthorDate: Mon Jun 17 00:57:36 2024 +0000

    Bump jakarta.servlet:jakarta.servlet-api from 6.0.0 to 6.1.0
    
    Bumps [jakarta.servlet:jakarta.servlet-api](https://github.com/eclipse-ee4j/servlet-api) from 6.0.0 to 6.1.0.
    - [Commits](https://github.com/eclipse-ee4j/servlet-api/commits)
    
    ---
    updated-dependencies:
    - dependency-name: jakarta.servlet:jakarta.servlet-api
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <su...@github.com>
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index d033e2be05..fb73638921 100644
--- a/pom.xml
+++ b/pom.xml
@@ -67,7 +67,7 @@
 
     <!-- These two must be in-step -->
     <ver.jetty>12.0.10</ver.jetty>
-    <ver.jakarta-servlet>6.0.0</ver.jakarta-servlet>
+    <ver.jakarta-servlet>6.1.0</ver.jakarta-servlet>
 
     <ver.shiro>2.0.1</ver.shiro>
 


(jena) 02/02: Update example for jakarta.servlet API 6.1

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git

commit 4ecc87dab3710e78d4aa5603dad8900a8a74a5b2
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Mon Jun 17 11:00:58 2024 +0100

    Update example for jakarta.servlet API 6.1
---
 .../main/examples/ExFusekiMain_3_FusekiModule.java | 25 +++++++++++++---------
 .../apache/jena/test/conn/StringHolderServlet.java |  3 ++-
 2 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/examples/ExFusekiMain_3_FusekiModule.java b/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/examples/ExFusekiMain_3_FusekiModule.java
index fddb15d8c8..4c323c713a 100644
--- a/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/examples/ExFusekiMain_3_FusekiModule.java
+++ b/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/examples/ExFusekiMain_3_FusekiModule.java
@@ -26,7 +26,6 @@ import java.net.http.HttpResponse;
 import java.net.http.HttpResponse.BodyHandlers;
 import java.util.Set;
 
-import jakarta.servlet.ServletException;
 import jakarta.servlet.http.HttpServlet;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
@@ -41,6 +40,10 @@ import org.apache.jena.rdf.model.Model;
 import org.apache.jena.sys.JenaSystem;
 import org.apache.jena.web.HttpSC;
 
+/**
+ * Example of adding a servlet that provides doPatch.
+ * The implementation only prints out details to show it has been called.
+ */
 public class ExFusekiMain_3_FusekiModule {
 
     public static void main(String...a) throws Exception {
@@ -87,16 +90,18 @@ public class ExFusekiMain_3_FusekiModule {
 
         @Override public void prepare(FusekiServer.Builder builder, Set<String> datasetNames, Model configModel) {
             System.out.println("Module adds servlet");
+            // Servlet API 6.1 adds "doPatch"
             HttpServlet servlet = new HttpServlet() {
-                @Override public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
-                    if ( req.getMethod().equalsIgnoreCase("PATCH") ) {
-                        doPatch(req, res);
-                        return ;
-                    }
-                    super.service(req, res);
-                }
-
-                private void doPatch(HttpServletRequest req, HttpServletResponse res) throws IOException {
+                // Servlet API 6.0 and earlier did not provide doPatch.
+//                @Override public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
+//                    if ( req.getMethod().equalsIgnoreCase("PATCH") ) {
+//                        doPatch(req, res);
+//                        return ;
+//                    }
+//                    super.service(req, res);
+//                }
+                @Override
+                protected void doPatch(HttpServletRequest req, HttpServletResponse res) throws IOException {
                     String x = IO.readWholeFileAsUTF8(req.getInputStream());
                     System.out.println("HTTP PATCH: "+x);
                     res.setStatus(HttpSC.OK_200);
diff --git a/jena-integration-tests/src/test/java/org/apache/jena/test/conn/StringHolderServlet.java b/jena-integration-tests/src/test/java/org/apache/jena/test/conn/StringHolderServlet.java
index 270bbdfccd..bd486db578 100644
--- a/jena-integration-tests/src/test/java/org/apache/jena/test/conn/StringHolderServlet.java
+++ b/jena-integration-tests/src/test/java/org/apache/jena/test/conn/StringHolderServlet.java
@@ -51,7 +51,8 @@ public class StringHolderServlet extends HttpServlet {
         super.service(req, resp);
     }
 
-    private void doPatch(HttpServletRequest req, HttpServletResponse resp) throws IOException {
+    @Override
+    protected void doPatch(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         String x = IO.readWholeFileAsUTF8(req.getInputStream());
         content.setOpaque(content.get() + x);
         resp.setStatus(HttpSC.OK_200);