You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/12/10 11:40:29 UTC

[tomcat] 02/02: Partial removal of the Servlet 4 preview API

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

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit bc3edae119f878b862f73d6e00b12a05551532e5
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Dec 10 11:31:47 2019 +0000

    Partial removal of the Servlet 4 preview API
---
 .../apache/catalina/core/ApplicationContext.java   |  10 +-
 .../catalina/core/ApplicationContextFacade.java    |  10 +-
 java/org/apache/catalina/core/StandardContext.java |  46 +-----
 .../catalina/servlet4preview/AsyncContext.java     |  31 ----
 .../catalina/servlet4preview/GenericFilter.java    |  95 ------------
 .../servlet4preview/RequestDispatcher.java         |  55 -------
 .../catalina/servlet4preview/ServletContext.java   | 164 ---------------------
 .../catalina/servlet4preview/http/HttpFilter.java  | 105 -------------
 .../catalina/servlet4preview/package-info.java     |  36 -----
 webapps/docs/changelog.xml                         |  10 ++
 10 files changed, 13 insertions(+), 549 deletions(-)

diff --git a/java/org/apache/catalina/core/ApplicationContext.java b/java/org/apache/catalina/core/ApplicationContext.java
index a476903..3561324 100644
--- a/java/org/apache/catalina/core/ApplicationContext.java
+++ b/java/org/apache/catalina/core/ApplicationContext.java
@@ -88,8 +88,7 @@ import org.apache.tomcat.util.res.StringManager;
  * @author Craig R. McClanahan
  * @author Remy Maucherat
  */
-@SuppressWarnings("deprecation")
-public class ApplicationContext implements org.apache.catalina.servlet4preview.ServletContext {
+public class ApplicationContext implements ServletContext {
 
     protected static final boolean STRICT_SERVLET_COMPLIANCE;
 
@@ -867,7 +866,6 @@ public class ApplicationContext implements org.apache.catalina.servlet4preview.S
     }
 
 
-    @Override
     public Dynamic addJspFile(String jspName, String jspFile) {
 
         // jspName is validated in addServlet()
@@ -1301,13 +1299,11 @@ public class ApplicationContext implements org.apache.catalina.servlet4preview.S
     }
 
 
-    @Override
     public int getSessionTimeout() {
         return context.getSessionTimeout();
     }
 
 
-    @Override
     public void setSessionTimeout(int sessionTimeout) {
         if (!context.getState().equals(LifecycleState.STARTING_PREP)) {
             throw new IllegalStateException(
@@ -1319,13 +1315,11 @@ public class ApplicationContext implements org.apache.catalina.servlet4preview.S
     }
 
 
-    @Override
     public String getRequestCharacterEncoding() {
         return context.getRequestCharacterEncoding();
     }
 
 
-    @Override
     public void setRequestCharacterEncoding(String encoding) {
         if (!context.getState().equals(LifecycleState.STARTING_PREP)) {
             throw new IllegalStateException(
@@ -1337,13 +1331,11 @@ public class ApplicationContext implements org.apache.catalina.servlet4preview.S
     }
 
 
-    @Override
     public String getResponseCharacterEncoding() {
         return context.getResponseCharacterEncoding();
     }
 
 
-    @Override
     public void setResponseCharacterEncoding(String encoding) {
         if (!context.getState().equals(LifecycleState.STARTING_PREP)) {
             throw new IllegalStateException(
diff --git a/java/org/apache/catalina/core/ApplicationContextFacade.java b/java/org/apache/catalina/core/ApplicationContextFacade.java
index 911fdbf..3992c7e 100644
--- a/java/org/apache/catalina/core/ApplicationContextFacade.java
+++ b/java/org/apache/catalina/core/ApplicationContextFacade.java
@@ -57,8 +57,7 @@ import org.apache.tomcat.util.ExceptionUtils;
  *
  * @author Remy Maucherat
  */
-@SuppressWarnings("deprecation")
-public class ApplicationContextFacade implements org.apache.catalina.servlet4preview.ServletContext {
+public class ApplicationContextFacade implements ServletContext {
 
     // ---------------------------------------------------------- Attributes
     /**
@@ -539,7 +538,6 @@ public class ApplicationContextFacade implements org.apache.catalina.servlet4pre
     }
 
 
-    @Override
     public Dynamic addJspFile(String jspName, String jspFile) {
         if (SecurityUtil.isPackageProtectionEnabled()) {
             return (ServletRegistration.Dynamic) doPrivileged("addJspFile",
@@ -782,7 +780,6 @@ public class ApplicationContextFacade implements org.apache.catalina.servlet4pre
     }
 
 
-    @Override
     public int getSessionTimeout() {
         if (SecurityUtil.isPackageProtectionEnabled()) {
             return ((Integer) doPrivileged("getSessionTimeout", null)).intValue();
@@ -792,7 +789,6 @@ public class ApplicationContextFacade implements org.apache.catalina.servlet4pre
     }
 
 
-    @Override
     public void setSessionTimeout(int sessionTimeout) {
         if (SecurityUtil.isPackageProtectionEnabled()) {
             doPrivileged("setSessionTimeout", new Object[] { Integer.valueOf(sessionTimeout) });
@@ -802,7 +798,6 @@ public class ApplicationContextFacade implements org.apache.catalina.servlet4pre
     }
 
 
-    @Override
     public String getRequestCharacterEncoding() {
         if (SecurityUtil.isPackageProtectionEnabled()) {
             return (String) doPrivileged("getRequestCharacterEncoding", null);
@@ -812,7 +807,6 @@ public class ApplicationContextFacade implements org.apache.catalina.servlet4pre
     }
 
 
-    @Override
     public void setRequestCharacterEncoding(String encoding) {
         if (SecurityUtil.isPackageProtectionEnabled()) {
             doPrivileged("setRequestCharacterEncoding", new Object[] { encoding });
@@ -822,7 +816,6 @@ public class ApplicationContextFacade implements org.apache.catalina.servlet4pre
     }
 
 
-    @Override
     public String getResponseCharacterEncoding() {
         if (SecurityUtil.isPackageProtectionEnabled()) {
             return (String) doPrivileged("getResponseCharacterEncoding", null);
@@ -832,7 +825,6 @@ public class ApplicationContextFacade implements org.apache.catalina.servlet4pre
     }
 
 
-    @Override
     public void setResponseCharacterEncoding(String encoding) {
         if (SecurityUtil.isPackageProtectionEnabled()) {
             doPrivileged("setResponseCharacterEncoding", new Object[] { encoding });
diff --git a/java/org/apache/catalina/core/StandardContext.java b/java/org/apache/catalina/core/StandardContext.java
index 3691112..80e6558 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -6389,9 +6389,7 @@ public class StandardContext extends ContainerBase
     }
 
 
-    @SuppressWarnings("deprecation")
-    private static class NoPluggabilityServletContext
-            implements org.apache.catalina.servlet4preview.ServletContext {
+    private static class NoPluggabilityServletContext implements ServletContext {
 
         private final ServletContext sc;
 
@@ -6566,12 +6564,6 @@ public class StandardContext extends ContainerBase
         }
 
         @Override
-        public Dynamic addJspFile(String jspName, String jspFile) {
-            throw new UnsupportedOperationException(
-                    sm.getString("noPluggabilityServletContext.notAllowed"));
-        }
-
-        @Override
         public <T extends Servlet> T createServlet(Class<T> c)
                 throws ServletException {
             throw new UnsupportedOperationException(
@@ -6702,41 +6694,5 @@ public class StandardContext extends ContainerBase
         public String getVirtualServerName() {
             return sc.getVirtualServerName();
         }
-
-        @Override
-        public int getSessionTimeout() {
-            throw new UnsupportedOperationException(
-                    sm.getString("noPluggabilityServletContext.notAllowed"));
-        }
-
-        @Override
-        public void setSessionTimeout(int sessionTimeout) {
-            throw new UnsupportedOperationException(
-                    sm.getString("noPluggabilityServletContext.notAllowed"));
-        }
-
-        @Override
-        public String getRequestCharacterEncoding() {
-            throw new UnsupportedOperationException(
-                    sm.getString("noPluggabilityServletContext.notAllowed"));
-        }
-
-        @Override
-        public void setRequestCharacterEncoding(String encoding) {
-            throw new UnsupportedOperationException(
-                    sm.getString("noPluggabilityServletContext.notAllowed"));
-        }
-
-        @Override
-        public String getResponseCharacterEncoding() {
-            throw new UnsupportedOperationException(
-                    sm.getString("noPluggabilityServletContext.notAllowed"));
-        }
-
-        @Override
-        public void setResponseCharacterEncoding(String encoding) {
-            throw new UnsupportedOperationException(
-                    sm.getString("noPluggabilityServletContext.notAllowed"));
-        }
     }
 }
diff --git a/java/org/apache/catalina/servlet4preview/AsyncContext.java b/java/org/apache/catalina/servlet4preview/AsyncContext.java
deleted file mode 100644
index dba5008..0000000
--- a/java/org/apache/catalina/servlet4preview/AsyncContext.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.
- */
-package org.apache.catalina.servlet4preview;
-
-/**
- * @deprecated This class is not included in Tomcat 9 onwards. Users of this
- *             class should normally upgrade to Tomcat 9 and switch to the
- *             Servlet 4.0 API. If the functionality is required in Tomcat 8.5,
- *             then the Tomcat implementation classes should be used directly.
- *             This class may be removed from Tomcat 8.5.x some time after 30
- *             September 2018.
- */
-@Deprecated
-public interface AsyncContext extends javax.servlet.AsyncContext {
-
-    public static final String ASYNC_MAPPING = "javax.servlet.async.mapping";
-}
diff --git a/java/org/apache/catalina/servlet4preview/GenericFilter.java b/java/org/apache/catalina/servlet4preview/GenericFilter.java
deleted file mode 100644
index 581c19b..0000000
--- a/java/org/apache/catalina/servlet4preview/GenericFilter.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * 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.
- */
-package org.apache.catalina.servlet4preview;
-
-import java.io.Serializable;
-import java.util.Enumeration;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-
-/**
- * @deprecated This class is not included in Tomcat 9 onwards. Users of this
- *             class should normally upgrade to Tomcat 9 and switch to the
- *             Servlet 4.0 API. If the functionality is required in Tomcat 8.5,
- *             then the Tomcat implementation classes should be used directly.
- *             This class may be removed from Tomcat 8.5.x some time after 30
- *             September 2018.
- */
-@Deprecated
-public abstract class GenericFilter implements Filter, FilterConfig, Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    private volatile FilterConfig filterConfig;
-
-
-    @Override
-    public String getInitParameter(String name) {
-        return getFilterConfig().getInitParameter(name);
-    }
-
-
-    @Override
-    public Enumeration<String> getInitParameterNames() {
-        return getFilterConfig().getInitParameterNames();
-    }
-
-
-    /**
-     * Obtain the FilterConfig used to initialise this Filter instance.
-     *
-     * @return The config previously passed to the {@link #init(FilterConfig)}
-     *         method
-     */
-    public FilterConfig getFilterConfig() {
-        return filterConfig;
-    }
-
-
-    @Override
-    public ServletContext getServletContext() {
-        return getFilterConfig().getServletContext();
-    }
-
-
-    @Override
-    public void init(FilterConfig filterConfig) throws ServletException {
-        this.filterConfig  = filterConfig;
-        init();
-    }
-
-
-    /**
-     * Convenience method for sub-classes to save them having to call
-     * <code>super.init(config)</code>. This is a NO-OP by default.
-     *
-     * @throws ServletException If an exception occurs that interrupts the
-     *         Filter's normal operation
-     */
-    public void init() throws ServletException {
-        // NO-OP
-    }
-
-
-    @Override
-    public String getFilterName() {
-        return getFilterConfig().getFilterName();
-    }
-}
diff --git a/java/org/apache/catalina/servlet4preview/RequestDispatcher.java b/java/org/apache/catalina/servlet4preview/RequestDispatcher.java
deleted file mode 100644
index 6ec0ffc..0000000
--- a/java/org/apache/catalina/servlet4preview/RequestDispatcher.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.
- */
-package org.apache.catalina.servlet4preview;
-
-/**
- * Provides early access to some parts of the proposed Servlet 4.0 API.
- *
- * @deprecated This class is not included in Tomcat 9 onwards. Users of this
- *             class should normally upgrade to Tomcat 9 and switch to the
- *             Servlet 4.0 API. If the functionality is required in Tomcat 8.5,
- *             then the Tomcat implementation classes should be used directly.
- *             This class may be removed from Tomcat 8.5.x some time after 30
- *             September 2018.
- */
-@Deprecated
-public interface RequestDispatcher extends javax.servlet.RequestDispatcher {
-
-    /**
-     * The name of the request attribute that should be set by the container
-     * when the {@link #forward(javax.servlet.ServletRequest,
-     * javax.servlet.ServletResponse)} method is called. It provides the
-     * original value of a path-related property of the request. See the chapter
-     * "Forwarded Request Parameters" in the Servlet Specification for details.
-     *
-     * @since Servlet 4.0
-     */
-    static final String FORWARD_MAPPING = "javax.servlet.forward.mapping";
-
-    /**
-     * The name of the request attribute that should be set by the container
-     * when the {@link #include(javax.servlet.ServletRequest,
-     * javax.servlet.ServletResponse)} method is called on the
-     * {@code RequestDispatcher} obtained by a path and not by a name.
-     * It provides information on the path that was used to obtain the
-     * {@code RequestDispatcher} instance for this include call. See the chapter
-     * "Included Request Parameters" in the Servlet Specification for details.
-     *
-     * @since Servlet 4.0
-     */
-    static final String INCLUDE_MAPPING = "javax.servlet.include.mapping";
-}
diff --git a/java/org/apache/catalina/servlet4preview/ServletContext.java b/java/org/apache/catalina/servlet4preview/ServletContext.java
deleted file mode 100644
index bddc93f..0000000
--- a/java/org/apache/catalina/servlet4preview/ServletContext.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * 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.
- */
-package org.apache.catalina.servlet4preview;
-
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-import javax.servlet.ServletRegistration;
-
-/**
- * Provides early access to some parts of the proposed Servlet 4.0 API.
- *
- * @deprecated This class is not included in Tomcat 9 onwards. Users of this
- *             class should normally upgrade to Tomcat 9 and switch to the
- *             Servlet 4.0 API. If the functionality is required in Tomcat 8.5,
- *             then the Tomcat implementation classes should be used directly.
- *             This class may be removed from Tomcat 8.5.x some time after 30
- *             September 2018.
- */
-@Deprecated
-public interface ServletContext extends javax.servlet.ServletContext {
-
-    /**
-     *
-     * @param jspName   The servlet name under which this JSP file should be
-     *                  registered
-     * @param jspFile   The path, relative to the web application root, for the
-     *                  JSP file to be used for this servlet
-     *
-     * @return  a {@link javax.servlet.ServletRegistration.Dynamic} object
-     *          that can be used to further configure the servlet
-     *
-     * @since Servlet 4.0
-     */
-    public ServletRegistration.Dynamic addJspFile(String jspName, String jspFile);
-
-    /**
-     * Get the default session timeout.
-     *
-     * @return The current default session timeout in minutes
-     *
-     * @throws UnsupportedOperationException    If called from a
-     *    {@link ServletContextListener#contextInitialized(ServletContextEvent)}
-     *    method of a {@link ServletContextListener} that was not defined in a
-     *    web.xml file, a web-fragment.xml file nor annotated with
-     *    {@link javax.servlet.annotation.WebListener}. For example, a
-     *    {@link ServletContextListener} defined in a TLD would not be able to
-     *    use this method.
-     *
-     * @since Servlet 4.0
-     */
-    public int getSessionTimeout();
-
-    /**
-     * Set the default session timeout. This method may only be called before
-     * the ServletContext is initialised.
-     *
-     * @param sessionTimeout The new default session timeout in minutes.
-     *
-     * @throws UnsupportedOperationException    If called from a
-     *    {@link ServletContextListener#contextInitialized(ServletContextEvent)}
-     *    method of a {@link ServletContextListener} that was not defined in a
-     *    web.xml file, a web-fragment.xml file nor annotated with
-     *    {@link javax.servlet.annotation.WebListener}. For example, a
-     *    {@link ServletContextListener} defined in a TLD would not be able to
-     *    use this method.
-     * @throws IllegalStateException If the ServletContext has already been
-     *         initialised
-     *
-     * @since Servlet 4.0
-     */
-    public void setSessionTimeout(int sessionTimeout);
-
-    /**
-     * Get the default character encoding for reading request bodies.
-     *
-     * @return The character encoding name or {@code null} if no default has
-     *         been specified
-     *
-     * @throws UnsupportedOperationException    If called from a
-     *    {@link ServletContextListener#contextInitialized(ServletContextEvent)}
-     *    method of a {@link ServletContextListener} that was not defined in a
-     *    web.xml file, a web-fragment.xml file nor annotated with
-     *    {@link javax.servlet.annotation.WebListener}. For example, a
-     *    {@link ServletContextListener} defined in a TLD would not be able to
-     *    use this method.
-     *
-     * @since Servlet 4.0
-     */
-    public String getRequestCharacterEncoding();
-
-    /**
-     * Set the default character encoding to use for reading request bodies.
-     * Calling this method will over-ride any value set in the deployment
-     * descriptor.
-     *
-     * @param encoding The name of the character encoding to use
-     *
-     * @throws UnsupportedOperationException    If called from a
-     *    {@link ServletContextListener#contextInitialized(ServletContextEvent)}
-     *    method of a {@link ServletContextListener} that was not defined in a
-     *    web.xml file, a web-fragment.xml file nor annotated with
-     *    {@link javax.servlet.annotation.WebListener}. For example, a
-     *    {@link ServletContextListener} defined in a TLD would not be able to
-     *    use this method.
-     * @throws IllegalStateException If the ServletContext has already been
-     *         initialised
-     *
-     * @since Servlet 4.0
-     */
-    public void setRequestCharacterEncoding(String encoding);
-
-    /**
-     * Get the default character encoding for writing response bodies.
-     *
-     * @return The character encoding name or {@code null} if no default has
-     *         been specified
-     *
-     * @throws UnsupportedOperationException    If called from a
-     *    {@link ServletContextListener#contextInitialized(ServletContextEvent)}
-     *    method of a {@link ServletContextListener} that was not defined in a
-     *    web.xml file, a web-fragment.xml file nor annotated with
-     *    {@link javax.servlet.annotation.WebListener}. For example, a
-     *    {@link ServletContextListener} defined in a TLD would not be able to
-     *    use this method.
-     *
-     * @since Servlet 4.0
-     */
-    public String getResponseCharacterEncoding();
-
-    /**
-     * Set the default character encoding to use for writing response bodies.
-     * Calling this method will over-ride any value set in the deployment
-     * descriptor.
-     *
-     * @param encoding The name of the character encoding to use
-     *
-     * @throws UnsupportedOperationException    If called from a
-     *    {@link ServletContextListener#contextInitialized(ServletContextEvent)}
-     *    method of a {@link ServletContextListener} that was not defined in a
-     *    web.xml file, a web-fragment.xml file nor annotated with
-     *    {@link javax.servlet.annotation.WebListener}. For example, a
-     *    {@link ServletContextListener} defined in a TLD would not be able to
-     *    use this method.
-     * @throws IllegalStateException If the ServletContext has already been
-     *         initialised
-     *
-     * @since Servlet 4.0
-     */
-    public void setResponseCharacterEncoding(String encoding);
-}
diff --git a/java/org/apache/catalina/servlet4preview/http/HttpFilter.java b/java/org/apache/catalina/servlet4preview/http/HttpFilter.java
deleted file mode 100644
index 4641335..0000000
--- a/java/org/apache/catalina/servlet4preview/http/HttpFilter.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * 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.
- */
-package org.apache.catalina.servlet4preview.http;
-
-import java.io.IOException;
-
-import javax.servlet.FilterChain;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.catalina.servlet4preview.GenericFilter;
-
-/**
- * @deprecated This class is not included in Tomcat 9 onwards. Users of this
- *             class should normally upgrade to Tomcat 9 and switch to the
- *             Servlet 4.0 API. If the functionality is required in Tomcat 8.5,
- *             then the Tomcat implementation classes should be used directly.
- *             This class may be removed from Tomcat 8.5.x some time after 30
- *             September 2018.
- */
-@Deprecated
-public abstract class HttpFilter extends GenericFilter {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * {@inheritDoc}
-     *
-     * This implementation tests the request and response to see if they are
-     * instances of {@link HttpServletRequest} and {@link HttpServletResponse}
-     * respectively. If they are then they are passed to
-     * {@link #doFilter(HttpServletRequest, HttpServletResponse, FilterChain)}.
-     * If not, a {@link ServletException} is thrown.
-     *
-     * @throws ServletException If either the request or response are not of the
-     *         expected types or any other error occurs
-     */
-    @Override
-    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
-            throws IOException, ServletException {
-        if (!(request instanceof HttpServletRequest)) {
-            throw new ServletException(request + " not HttpServletRequest");
-        }
-        if (!(response instanceof HttpServletResponse)) {
-            throw new ServletException(request + " not HttpServletResponse");
-        }
-        doFilter((HttpServletRequest) request, (HttpServletResponse) response, chain);
-    }
-
-
-    /**
-     * The <code>doFilter</code> method of the Filter is called by the container
-     * each time a request/response pair is passed through the chain due to a
-     * client request for a resource at the end of the chain. The FilterChain
-     * passed in to this method allows the Filter to pass on the request and
-     * response to the next entity in the chain.
-     * <p>
-     * A typical implementation of this method would follow the following
-     * pattern:- <br>
-     * 1. Examine the request<br>
-     * 2. Optionally wrap the request object with a custom implementation to
-     * filter content or headers for input filtering <br>
-     * 3. Optionally wrap the response object with a custom implementation to
-     * filter content or headers for output filtering <br>
-     * 4. a) <strong>Either</strong> invoke the next entity in the chain using
-     * the FilterChain object (<code>chain.doFilter()</code>), <br>
-     * 4. b) <strong>or</strong> not pass on the request/response pair to the
-     * next entity in the filter chain to block the request processing<br>
-     * 5. Directly set headers on the response after invocation of the next
-     * entity in the filter chain.
-     *
-     * This default implementation simply calls the next filter in the filter
-     * chain.
-     *
-     * @param request  The request to process
-     * @param response The response associated with the request
-     * @param chain    Provides access to the next filter in the chain for this
-     *                 filter to pass the request and response to for further
-     *                 processing
-     *
-     * @throws IOException if an I/O error occurs during this filter's
-     *                     processing of the request
-     * @throws ServletException if the processing fails for any other reason
-     */
-    protected void doFilter(HttpServletRequest request, HttpServletResponse response,
-            FilterChain chain) throws IOException, ServletException {
-        chain.doFilter(request, response);
-    }
-}
diff --git a/java/org/apache/catalina/servlet4preview/package-info.java b/java/org/apache/catalina/servlet4preview/package-info.java
deleted file mode 100644
index 59692df..0000000
--- a/java/org/apache/catalina/servlet4preview/package-info.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.
- */
-
-/**
- * This package provides early access to some of the new features in the Servlet
- * 4.0 API. This package exists in Tomcat 8.5 only. The package will not exist
- * in Tomcat 9 and applications depending on classes in this package will need
- * to be modified before they will work with Tomcat 9. It is intended that any
- * such modifications will be limited to replacing
- * <code>import org.apache.catalina.servlet4preview...</code> with
- * <code>import javax.servlet...</code> and removing casts.
- * <p>
- * This package is not a complete copy of the proposed Servlet 4.0 API. It
- * contains only a sub-set of those classes that are new or modified in Servlet
- * 4.0. Users may request the inclusion of additional Servlet 4.0 API changes in
- * this package via a Bugzilla enhancement request against Tomcat 8.5.
- * <p>
- * The Servlet 4.0 API is a work in progress. The public API of classes in this
- * package may change in incompatible ways - including classes being renamed or
- * deleted - between point releases of Tomcat 8.5.
- */
-package org.apache.catalina.servlet4preview;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 8d11413..6e31f17 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -45,6 +45,16 @@
   issues do not "pop up" wrt. others).
 -->
 <section name="Tomcat 8.5.51 (markt)" rtext="in development">
+  <subsection name="Catalina">
+    <changelog>
+      <scode>
+        Remove part of the deprecated Servlet 4 Preview API. Users still
+        depending on this feature should ideally upgrade to Tomcat 9.0.x. If
+        upgrade is not possible, application code should cast to the internal
+        Tomcat implemenation classes. (markt)
+      </scode>
+    </changelog>
+  </subsection>
   <subsection name="Coyote">
     <changelog>
       <fix>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org