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/felix-dev.git
The following commit(s) were added to refs/heads/master by this push: new c85ca97e5b FELIX-6762 : Support Jakarta Servlet 6.1 c85ca97e5b is described below commit c85ca97e5b5a9f10e4dd24adf8b85b89bfec8800 Author: Carsten Ziegeler <cziege...@apache.org> AuthorDate: Thu Apr 3 06:57:15 2025 +0200 FELIX-6762 : Support Jakarta Servlet 6.1 --- http/wrappers/pom.xml | 12 ++++++------ .../http/jakartawrappers/HttpServletResponseWrapper.java | 11 +++++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/http/wrappers/pom.xml b/http/wrappers/pom.xml index d89f91a9fe..86edd31183 100644 --- a/http/wrappers/pom.xml +++ b/http/wrappers/pom.xml @@ -6,9 +6,9 @@ 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 @@ -28,7 +28,7 @@ <name>Apache Felix Http Wrappers</name> <artifactId>org.apache.felix.http.wrappers</artifactId> - <version>1.1.11-SNAPSHOT</version> + <version>1.2.0-SNAPSHOT</version> <packaging>bundle</packaging> <scm> @@ -69,7 +69,7 @@ <instructions> <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> <Bundle-Version>${project.version}</Bundle-Version> - </instructions> + </instructions> </configuration> </plugin> </plugins> @@ -97,7 +97,7 @@ <dependency> <groupId>jakarta.servlet</groupId> <artifactId>jakarta.servlet-api</artifactId> - <version>6.0.0</version> + <version>6.1.0</version> <scope>provided</scope> </dependency> <dependency> @@ -109,7 +109,7 @@ <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> - <version>5.7.0</version> + <version>5.16.1</version> <scope>test</scope> </dependency> </dependencies> diff --git a/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/HttpServletResponseWrapper.java b/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/HttpServletResponseWrapper.java index 86d73e21c7..b84884e03d 100644 --- a/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/HttpServletResponseWrapper.java +++ b/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/HttpServletResponseWrapper.java @@ -130,4 +130,15 @@ public class HttpServletResponseWrapper extends ServletResponseWrapper public Collection<String> getHeaderNames() { return this.response.getHeaderNames(); } + + @Override + public void sendRedirect(final String location, final int sc, final boolean clearBuffer) throws IOException { + if (!clearBuffer) { + throw new IOException("javax.servlet API does not support sendRedirect(String, int, false)"); + } + if (sc != 302) { + throw new IOException("javax.servlet API does not support sendRedirect(String, int, boolean) with sc != 302"); + } + this.response.sendRedirect(location); + } }