You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2025/01/06 08:32:07 UTC
(sling-whiteboard) branch master updated: Update mdresourcedecorator to use Jakarta Servlet API
This is an automated email from the ASF dual-hosted git repository.
cziegeler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git
The following commit(s) were added to refs/heads/master by this push:
new 904ae2a1 Update mdresourcedecorator to use Jakarta Servlet API
904ae2a1 is described below
commit 904ae2a146910ca69374cf029ace253dd12bd6b1
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Jan 6 09:32:02 2025 +0100
Update mdresourcedecorator to use Jakarta Servlet API
---
mdresourcedecorator/pom.xml | 28 +++++++++++++---------
.../apache/sling/mdresource/impl/HtmlServlet.java | 14 +++++------
sling-mini/src/main/features/sling.json | 10 +++++++-
3 files changed, 33 insertions(+), 19 deletions(-)
diff --git a/mdresourcedecorator/pom.xml b/mdresourcedecorator/pom.xml
index c707171e..8db96cfe 100644
--- a/mdresourcedecorator/pom.xml
+++ b/mdresourcedecorator/pom.xml
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
- license agreements. See the NOTICE file distributed with this work for additional
- information regarding copyright ownership. The ASF licenses this file to
- you under the Apache License, Version 2.0 (the "License"); you may not use
- this file except in compliance with the License. You may obtain a copy of
- the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -62,6 +62,12 @@
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>jakarta.servlet</groupId>
+ <artifactId>jakarta.servlet-api</artifactId>
+ <version>6.0.0</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.owasp.encoder</groupId>
<artifactId>encoder</artifactId>
@@ -71,7 +77,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.api</artifactId>
- <version>2.27.2</version>
+ <version>2.28.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -98,6 +104,6 @@
<version>5.5.0</version>
<scope>test</scope>
</dependency>
-
+
</dependencies>
</project>
diff --git a/mdresourcedecorator/src/main/java/org/apache/sling/mdresource/impl/HtmlServlet.java b/mdresourcedecorator/src/main/java/org/apache/sling/mdresource/impl/HtmlServlet.java
index aa2f85c5..61483af0 100644
--- a/mdresourcedecorator/src/main/java/org/apache/sling/mdresource/impl/HtmlServlet.java
+++ b/mdresourcedecorator/src/main/java/org/apache/sling/mdresource/impl/HtmlServlet.java
@@ -23,13 +23,13 @@ import java.io.PrintWriter;
import java.util.List;
import java.util.Map;
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.Servlet;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServlet;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
-import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.SlingJakartaHttpServletRequest;
import org.apache.sling.api.resource.ValueMap;
import org.apache.sling.servlets.annotations.SlingServletResourceTypes;
import org.osgi.service.component.annotations.Activate;
@@ -75,7 +75,7 @@ public class HtmlServlet extends HttpServlet {
@SuppressWarnings("unchecked")
protected void doGet(final HttpServletRequest req, final HttpServletResponse resp)
throws ServletException, IOException {
- final SlingHttpServletRequest request = (SlingHttpServletRequest) req;
+ final SlingJakartaHttpServletRequest request = (SlingJakartaHttpServletRequest) req;
resp.setContentType("text/html");
resp.setCharacterEncoding("UTF-8");
final PrintWriter pw = resp.getWriter();
diff --git a/sling-mini/src/main/features/sling.json b/sling-mini/src/main/features/sling.json
index 87eadef6..308e2b08 100644
--- a/sling-mini/src/main/features/sling.json
+++ b/sling-mini/src/main/features/sling.json
@@ -5,7 +5,15 @@
"start-order":"1"
},
{
- "id":"commons-io:commons-io:2.13.0",
+ "id":"org.apache.commons:commons-fileupload2-core:2.0.0-M2",
+ "start-order":"1"
+ },
+ {
+ "id":"org.apache.commons:commons-fileupload2-jakarta-servlet5:2.0.0-M2",
+ "start-order":"1"
+ },
+ {
+ "id":"commons-io:commons-io:2.17.0",
"start-order":"1"
},
{