[Git][java-team/jakarta-servlet-api][master] 3 commits: Restored the backward compatibility with the Jakarta Servlet API 5.0

Emmanuel Bourg (@ebourg) gitlab at salsa.debian.org
Fri Feb 13 08:06:02 GMT 2026



Emmanuel Bourg pushed to branch master at Debian Java Maintainers / jakarta-servlet-api


Commits:
22e1980e by Emmanuel Bourg at 2026-02-13T08:37:42+01:00
Restored the backward compatibility with the Jakarta Servlet API 5.0

- - - - -
7e9d9d13 by Emmanuel Bourg at 2026-02-13T08:37:52+01:00
Standards-Version updated to 4.7.3

- - - - -
b7fb0bea by Emmanuel Bourg at 2026-02-13T09:05:41+01:00
Upload to unstable

- - - - -


4 changed files:

- debian/changelog
- debian/control
- + debian/patches/01-backward-compatibility.patch
- + debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+jakarta-servlet-api (6.1.0-2) unstable; urgency=medium
+
+  * Restored the backward compatibility with the Jakarta Servlet API 5.0
+  * Standards-Version updated to 4.7.3
+
+ -- Emmanuel Bourg <ebourg at apache.org>  Fri, 13 Feb 2026 08:38:04 +0100
+
 jakarta-servlet-api (6.1.0-1) unstable; urgency=medium
 
   * New upstream release


=====================================
debian/control
=====================================
@@ -10,7 +10,7 @@ Build-Depends:
  libmaven-bundle-plugin-java (>= 3.5.1),
  libmaven-javadoc-plugin-java,
  maven-debian-helper (>= 2.1)
-Standards-Version: 4.7.0
+Standards-Version: 4.7.3
 Vcs-Git: https://salsa.debian.org/java-team/jakarta-servlet-api.git
 Vcs-Browser: https://salsa.debian.org/java-team/jakarta-servlet-api
 Homepage: https://projects.eclipse.org/projects/ee4j.servlet


=====================================
debian/patches/01-backward-compatibility.patch
=====================================
@@ -0,0 +1,493 @@
+Description: Restores the backward compatibility with the Jakarta Servlet API 5.0
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: not-needed
+--- a/api/src/main/java/jakarta/servlet/ServletRequest.java
++++ b/api/src/main/java/jakarta/servlet/ServletRequest.java
+@@ -427,6 +427,18 @@
+     RequestDispatcher getRequestDispatcher(String path);
+ 
+     /**
++     * @param path the path for which the real path is to be returned.
++     *
++     * @return the <i>real</i> path, or <tt>null</tt> if the translation cannot be performed.
++     *
++     * @deprecated As of Version 2.1 of the Java Servlet API, use {@link ServletContext#getRealPath} instead.
++     */
++    @Deprecated
++    default public String getRealPath(String path) {
++        return null;
++    }
++
++    /**
+      * Returns the Internet Protocol (IP) source port the remote end of the connection on which the request was received. By
+      * default this is either the port of the client or last proxy that sent the request. In some cases, protocol specific
+      * mechanisms such as <a href="https://tools.ietf.org/html/rfc7239">RFC 7239</a> may be used to obtain a port different
+@@ -654,7 +666,9 @@
+      *
+      * @since Servlet 6.0
+      */
+-    String getRequestId();
++    default String getRequestId() {
++        throw new UnsupportedOperationException();
++    }
+ 
+     /**
+      * Obtain the request identifier for this request as defined by the protocol in use. Note that some protocols do not
+@@ -676,7 +690,9 @@
+      *
+      * @since Servlet 6.0
+      */
+-    String getProtocolRequestId();
++    default String getProtocolRequestId() {
++        throw new UnsupportedOperationException();
++    }
+ 
+     /**
+      * Obtain details of the network connection to the Servlet container that is being used by this request. The information
+@@ -687,5 +703,7 @@
+      *
+      * @since Servlet 6.0
+      */
+-    ServletConnection getServletConnection();
++    default ServletConnection getServletConnection() {
++        throw new UnsupportedOperationException();
++    }
+ }
+--- a/api/src/main/java/jakarta/servlet/SessionCookieConfig.java
++++ b/api/src/main/java/jakarta/servlet/SessionCookieConfig.java
+@@ -253,7 +253,8 @@
+      *
+      * @since Servlet 6.0
+      */
+-    void setAttribute(String name, String value);
++    default void setAttribute(String name, String value) {
++    }
+ 
+     /**
+      * Obtain the value for a given session cookie attribute. Values returned from this method must be consistent with the
+@@ -265,7 +266,9 @@
+      *
+      * @since Servlet 6.0
+      */
+-    String getAttribute(String name);
++    default String getAttribute(String name) {
++        return null;
++    }
+ 
+     /**
+      * Obtain the Map (keys are case insensitive) of all attributes and values, including those set via the attribute
+@@ -275,5 +278,7 @@
+      *
+      * @since Servlet 6.0
+      */
+-    Map<String, String> getAttributes();
++    default Map<String, String> getAttributes() {
++        return null;
++    }
+ }
+--- a/api/src/main/java/jakarta/servlet/ServletRequestWrapper.java
++++ b/api/src/main/java/jakarta/servlet/ServletRequestWrapper.java
+@@ -290,6 +290,17 @@
+     }
+ 
+     /**
++     * The default behavior of this method is to return getRealPath(String path) on the wrapped request object.
++     *
++     * @deprecated As of Version 2.1 of the Java Servlet API, use {@link ServletContext#getRealPath} instead
++     */
++    @Override
++    @Deprecated
++    public String getRealPath(String path) {
++        return this.request.getRealPath(path);
++    }
++
++    /**
+      * The default behavior of this method is to return getRemotePort() on the wrapped request object.
+      *
+      * @since Servlet 2.4
+--- a/api/src/main/java/jakarta/servlet/http/HttpServletRequest.java
++++ b/api/src/main/java/jakarta/servlet/http/HttpServletRequest.java
+@@ -533,6 +533,17 @@
+     boolean isRequestedSessionIdFromURL();
+ 
+     /**
++     * @deprecated As of Version 2.1 of the Java Servlet API, use {@link #isRequestedSessionIdFromURL} instead.
++     *
++     * @return <code>true</code> if the session ID was conveyed to the server as part of a URL; otherwise,
++     * <code>false</code>
++     */
++    @Deprecated
++    default boolean isRequestedSessionIdFromUrl() {
++        return isRequestedSessionIdFromURL();
++    }
++
++    /**
+      * Use the container login mechanism configured for the <code>ServletContext</code> to authenticate the user making this
+      * request.
+      *
+--- a/api/src/main/java/jakarta/servlet/ServletContext.java
++++ b/api/src/main/java/jakarta/servlet/ServletContext.java
+@@ -371,6 +371,57 @@
+     RequestDispatcher getNamedDispatcher(String name);
+ 
+     /**
++     * @deprecated As of Java Servlet API 2.1, with no direct replacement.
++     *
++     * <p>
++     * This method was originally defined to retrieve a servlet from a <code>ServletContext</code>. In this version, this
++     * method always returns <code>null</code> and remains only to preserve binary compatibility. This method will be
++     * permanently removed in a future version of Jakarta Servlets.
++     *
++     * <p>
++     * In lieu of this method, servlets can share information using the <code>ServletContext</code> class and can perform
++     * shared business logic by invoking methods on common non-servlet classes.
++     *
++     * @param name the servlet name
++     * @return the {@code jakarta.servlet.Servlet Servlet} with the given name
++     * @throws ServletException if an exception has occurred that interfaces with servlet's normal operation
++     */
++    @Deprecated
++    default Servlet getServlet(String name) throws ServletException {
++        return null;
++    }
++
++    /**
++     * @deprecated As of Java Servlet API 2.0, with no replacement.
++     *
++     * <p>
++     * This method was originally defined to return an <code>Enumeration</code> of all the servlets known to this servlet
++     * context. In this version, this method always returns an empty enumeration and remains only to preserve binary
++     * compatibility. This method will be permanently removed in a future version of Jakarta Servlets.
++     *
++     * @return an <code>Enumeration</code> of {@code jakarta.servlet.Servlet Servlet}
++     */
++    @Deprecated
++    default Enumeration<Servlet> getServlets() {
++        return java.util.Collections.emptyEnumeration();
++    }
++
++    /**
++     * @deprecated As of Java Servlet API 2.1, with no replacement.
++     *
++     * <p>
++     * This method was originally defined to return an <code>Enumeration</code> of all the servlet names known to this
++     * context. In this version, this method always returns an empty <code>Enumeration</code> and remains only to preserve
++     * binary compatibility. This method will be permanently removed in a future version of Jakarta Servlets.
++     *
++     * @return an <code>Enumeration</code> of {@code jakarta.servlet.Servlet Servlet} names
++     */
++    @Deprecated
++    default Enumeration<String> getServletNames() {
++        return java.util.Collections.emptyEnumeration();
++    }
++
++    /**
+      *
+      * Writes the specified message to a servlet log file, usually an event log. The name and type of the servlet log file
+      * is specific to the servlet container.
+@@ -380,6 +431,21 @@
+     void log(String msg);
+ 
+     /**
++     * @deprecated As of Java Servlet API 2.1, use {@link #log(String message, Throwable throwable)} instead.
++     *
++     * <p>
++     * This method was originally defined to write an exception's stack trace and an explanatory error message to the
++     * servlet log file.
++     *
++     * @param exception the <code>Exception</code> error
++     * @param msg a <code>String</code> that describes the exception
++     */
++    @Deprecated
++    default void log(Exception exception, String msg) {
++        log(msg, exception);
++    }
++
++    /**
+      * Writes an explanatory message and a stack trace for a given <code>Throwable</code> exception to the servlet log file.
+      * The name and type of the servlet log file is specific to the servlet container, usually an event log.
+      *
+--- a/api/src/main/java/jakarta/servlet/http/HttpSession.java
++++ b/api/src/main/java/jakarta/servlet/http/HttpSession.java
+@@ -139,6 +139,18 @@
+     int getMaxInactiveInterval();
+ 
+     /**
++     *
++     * @deprecated As of Version 2.1, this method is deprecated and has no replacement. It will be removed in a future
++     * version of Jakarta Servlets.
++     *
++     * @return the {@link HttpSessionContext} for this session.
++     */
++    @Deprecated
++    default HttpSessionContext getSessionContext() {
++        throw new UnsupportedOperationException();
++    }
++
++    /**
+      * Returns the object bound with the specified name in this session, or <code>null</code> if no object is bound under
+      * the name.
+      *
+@@ -151,6 +163,20 @@
+     Object getAttribute(String name);
+ 
+     /**
++     * @deprecated As of Version 2.2, this method is replaced by {@link #getAttribute}.
++     *
++     * @param name a string specifying the name of the object
++     *
++     * @return the object with the specified name
++     *
++     * @exception IllegalStateException if this method is called on an invalidated session
++     */
++    @Deprecated
++    default Object getValue(String name) {
++        return getAttribute(name);
++    }
++
++    /**
+      * Returns an <code>Enumeration</code> of <code>String</code> objects containing the names of all the objects bound to
+      * this session.
+      *
+@@ -162,6 +188,18 @@
+     Enumeration<String> getAttributeNames();
+ 
+     /**
++     * @deprecated As of Version 2.2, this method is replaced by {@link #getAttributeNames}
++     *
++     * @return an array of <code>String</code> objects specifying the names of all the objects bound to this session
++     *
++     * @exception IllegalStateException if this method is called on an invalidated session
++     */
++    @Deprecated
++    default String[] getValueNames() {
++        return java.util.Collections.list(getAttributeNames()).toArray(new String[0]);
++    }
++
++    /**
+      * Binds an object to this session, using the name specified. If an object of the same name is already bound to the
+      * session, the object is replaced.
+      *
+@@ -187,6 +225,20 @@
+     void setAttribute(String name, Object value);
+ 
+     /**
++     * @deprecated As of Version 2.2, this method is replaced by {@link #setAttribute}
++     *
++     * @param name the name to which the object is bound; cannot be null
++     *
++     * @param value the object to be bound; cannot be null
++     *
++     * @exception IllegalStateException if this method is called on an invalidated session
++     */
++    @Deprecated
++    default void putValue(String name, Object value) {
++        setAttribute(name, value);
++    }
++
++    /**
+      * Removes the object bound with the specified name from this session. If the session does not have an object bound with
+      * the specified name, this method does nothing.
+      *
+@@ -202,6 +254,18 @@
+     void removeAttribute(String name);
+ 
+     /**
++     * @deprecated As of Version 2.2, this method is replaced by {@link #removeAttribute}
++     *
++     * @param name the name of the object to remove from this session
++     *
++     * @exception IllegalStateException if this method is called on an invalidated session
++     */
++    @Deprecated
++    default void removeValue(String name) {
++        removeAttribute(name);
++    }
++
++    /**
+      * Invalidates this session then unbinds any objects bound to it.
+      *
+      * @exception IllegalStateException if this method is called on an already invalidated session
+--- a/api/src/main/java/jakarta/servlet/http/HttpServletResponse.java
++++ b/api/src/main/java/jakarta/servlet/http/HttpServletResponse.java
+@@ -78,6 +78,18 @@
+     String encodeURL(String url);
+ 
+     /**
++     * @deprecated As of version 2.1, use encodeURL(String url) instead
++     *
++     * @param url the url to be encoded.
++     * @return the encoded URL if encoding is needed; the unchanged URL otherwise.
++     * @exception IllegalArgumentException if the url is not valid
++     */
++    @Deprecated
++    default String encodeUrl(String url) {
++        return encodeURL(url);
++    }
++
++    /**
+      * Encodes the specified URL for use in the <code>sendRedirect</code> method or, if encoding is not needed, returns the
+      * URL unchanged. The implementation of this method includes the logic to determine whether the session ID needs to be
+      * encoded in the URL. For example, if the browser supports cookies, or session tracking is turned off, URL encoding is
+@@ -100,6 +112,18 @@
+     String encodeRedirectURL(String url);
+ 
+     /**
++     * @deprecated As of version 2.1, use encodeRedirectURL(String url) instead
++     *
++     * @param url the url to be encoded.
++     * @return the encoded URL if encoding is needed; the unchanged URL otherwise.
++     * @exception IllegalArgumentException if the url is not valid
++     */
++    @Deprecated
++    default String encodeRedirectUrl(String url) {
++        return encodeRedirectURL(url);
++    }
++
++    /**
+      * <p>
+      * Sends an error response to the client using the specified status and clears the buffer. The server defaults to
+      * creating the response to look like an HTML-formatted server error page containing the specified message, setting the
+@@ -383,6 +407,20 @@
+     void setStatus(int sc);
+ 
+     /**
++     * @deprecated As of version 2.1, due to ambiguous meaning of the message parameter. To set a status code use
++     * <code>setStatus(int)</code>, to send an error with a description use <code>sendError(int, String)</code>.
++     *
++     * Sets the status code and message for this response.
++     *
++     * @param sc the status code
++     * @param sm the status message
++     */
++    @Deprecated
++    default void setStatus(int sc, String sm) {
++        setStatus(sc);
++    }
++
++    /**
+      * Gets the current status code of this response.
+      *
+      * @return the current status code of this response
+--- /dev/null
++++ b/api/src/main/java/jakarta/servlet/SingleThreadModel.java
+@@ -0,0 +1,44 @@
++/*
++ * Copyright (c) 1997, 2020 Oracle and/or its affiliates and others.
++ * All rights reserved.
++ * Copyright 2004 The Apache Software Foundation
++ *
++ * Licensed 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.
++ */
++
++package jakarta.servlet;
++
++/**
++ * Ensures that servlets handle only one request at a time. This interface has no methods.
++ *
++ * <p>
++ * If a servlet implements this interface, you are <i>guaranteed</i> that no two threads will execute concurrently in
++ * the servlet's <code>service</code> method. The servlet container can make this guarantee by synchronizing access to a
++ * single instance of the servlet, or by maintaining a pool of servlet instances and dispatching each new request to a
++ * free servlet.
++ *
++ * <p>
++ * Note that SingleThreadModel does not solve all thread safety issues. For example, session attributes and static
++ * variables can still be accessed by multiple requests on multiple threads at the same time, even when
++ * SingleThreadModel servlets are used. It is recommended that a developer take other means to resolve those issues
++ * instead of implementing this interface, such as avoiding the usage of an instance variable or synchronizing the block
++ * of the code accessing those resources. This interface is deprecated in Servlet API version 2.4.
++ *
++ *
++ * @author Various
++ *
++ * @deprecated As of Java Servlet API 2.4, with no direct replacement.
++ */
++ at Deprecated
++public interface SingleThreadModel {
++}
+--- /dev/null
++++ b/api/src/main/java/jakarta/servlet/http/HttpSessionContext.java
+@@ -0,0 +1,59 @@
++/*
++ * Copyright (c) 1997, 2020 Oracle and/or its affiliates and others.
++ * All rights reserved.
++ * Copyright 2004 The Apache Software Foundation
++ *
++ * Licensed 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.
++ */
++
++package jakarta.servlet.http;
++
++import java.util.Enumeration;
++
++/**
++ *
++ * @author Various
++ *
++ * @deprecated As of Java(tm) Servlet API 2.1 for security reasons, with no replacement. This interface will be removed
++ * in a future version of this API.
++ *
++ * @see HttpSession
++ * @see HttpSessionBindingEvent
++ * @see HttpSessionBindingListener
++ *
++ */
++ at Deprecated
++public interface HttpSessionContext {
++
++    /**
++     *
++     * @deprecated As of Java Servlet API 2.1 with no replacement. This method must return null and will be removed in a
++     * future version of this API.
++     * @param sessionId the id of the session to be returned
++     *
++     * @return null in all cases
++     */
++    @Deprecated
++    public HttpSession getSession(String sessionId);
++
++    /**
++     *
++     * @deprecated As of Java Servlet API 2.1 with no replacement. This method must return an empty <code>Enumeration</code>
++     * and will be removed in a future version of this API.
++     *
++     * @return null
++     *
++     */
++    @Deprecated
++    public Enumeration<String> getIds();
++}
+--- a/api/src/main/java/jakarta/servlet/descriptor/JspPropertyGroupDescriptor.java
++++ b/api/src/main/java/jakarta/servlet/descriptor/JspPropertyGroupDescriptor.java
+@@ -58,7 +58,9 @@
+      *
+      * @since Servlet 6.0
+      */
+-    String getErrorOnELNotFound();
++    default String getErrorOnELNotFound() {
++        return "false";
++    }
+ 
+     /**
+      * Gets the value of the <code>page-encoding</code> configuration, which specifies the default page encoding for any JSP


=====================================
debian/patches/series
=====================================
@@ -0,0 +1 @@
+01-backward-compatibility.patch



View it on GitLab: https://salsa.debian.org/java-team/jakarta-servlet-api/-/compare/9a195beafe3e7c5911c00fe08edac2d4945c5a50...b7fb0bea8f6824acfeeb0028725a8ad4d33867e9

-- 
View it on GitLab: https://salsa.debian.org/java-team/jakarta-servlet-api/-/compare/9a195beafe3e7c5911c00fe08edac2d4945c5a50...b7fb0bea8f6824acfeeb0028725a8ad4d33867e9
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20260213/8f4e0391/attachment.htm>


More information about the pkg-java-commits mailing list