diff --git a/build.gradle b/build.gradle index 73223bac372..a6d25090556 100644 --- a/build.gradle +++ b/build.gradle @@ -120,8 +120,8 @@ configure(allprojects) { project -> dependencySet(group: 'org.apache.tomcat', version: '10.0.12') { entry 'tomcat-util' entry('tomcat-websocket') { - exclude group: "org.apache.tomcat", name: "tomcat-websocket-api" exclude group: "org.apache.tomcat", name: "tomcat-servlet-api" + exclude group: "org.apache.tomcat", name: "tomcat-websocket-api" } } dependencySet(group: 'org.apache.tomcat.embed', version: '10.0.12') { @@ -130,9 +130,7 @@ configure(allprojects) { project -> } dependencySet(group: 'io.undertow', version: '2.2.12.Final') { entry 'undertow-core' - entry('undertow-servlet-jakartaee9') { - exclude group: "org.jboss.spec.javax.annotation", name: "jboss-annotations-api_1.3_spec" - } + entry 'undertow-servlet-jakartaee9' entry 'undertow-websockets-jsr-jakartaee9' } diff --git a/spring-aspects/spring-aspects.gradle b/spring-aspects/spring-aspects.gradle index 0461a8be3fb..6b319135dba 100644 --- a/spring-aspects/spring-aspects.gradle +++ b/spring-aspects/spring-aspects.gradle @@ -29,7 +29,7 @@ dependencies { optional(project(":spring-orm")) // for JPA exception translation support optional(project(":spring-tx")) // for JPA, @Transactional support optional("javax.cache:cache-api") // for JCache aspect - optional("jakarta.transaction:jakarta.transaction-api") // for @javax.transaction.Transactional support + optional("jakarta.transaction:jakarta.transaction-api") // for @jakarta.transaction.Transactional support testImplementation(project(":spring-core")) // for CodeStyleAspect testImplementation(project(":spring-test")) testImplementation(testFixtures(project(":spring-context"))) diff --git a/spring-web/src/main/java/org/springframework/http/server/ServletServerHttpAsyncRequestControl.java b/spring-web/src/main/java/org/springframework/http/server/ServletServerHttpAsyncRequestControl.java index 7833b92bbb1..db87ffb8e4f 100644 --- a/spring-web/src/main/java/org/springframework/http/server/ServletServerHttpAsyncRequestControl.java +++ b/spring-web/src/main/java/org/springframework/http/server/ServletServerHttpAsyncRequestControl.java @@ -29,7 +29,7 @@ import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** - * A {@link ServerHttpAsyncRequestControl} to use on Servlet containers (Servlet 3.0+). + * A {@link ServerHttpAsyncRequestControl} to use on Servlet containers. * * @author Rossen Stoyanchev * @since 4.0 @@ -62,7 +62,7 @@ public class ServletServerHttpAsyncRequestControl implements ServerHttpAsyncRequ "Async support must be enabled on a servlet and for all filters involved " + "in async request processing. This is done in Java code using the Servlet API " + "or by adding \"true\" to servlet and " + - "filter declarations in web.xml. Also you must use a Servlet 3.0+ container"); + "filter declarations in web.xml."); this.request = request; this.response = response; diff --git a/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractListenerReadPublisher.java b/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractListenerReadPublisher.java index 0845a9f25f0..210035f57f3 100644 --- a/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractListenerReadPublisher.java +++ b/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractListenerReadPublisher.java @@ -35,7 +35,7 @@ import org.springframework.util.Assert; * event-listener read APIs and Reactive Streams. * *

Specifically a base class for reading from the HTTP request body with - * Servlet 3.1 non-blocking I/O and Undertow XNIO as well as handling incoming + * Servlet non-blocking I/O and Undertow XNIO as well as handling incoming * WebSocket messages with standard Java WebSocket (JSR-356), Jetty, and * Undertow. * diff --git a/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractListenerServerHttpResponse.java b/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractListenerServerHttpResponse.java index 75c9bc7113b..45cc2f7787f 100644 --- a/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractListenerServerHttpResponse.java +++ b/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractListenerServerHttpResponse.java @@ -27,8 +27,7 @@ import org.springframework.core.io.buffer.DataBufferFactory; import org.springframework.http.HttpHeaders; /** - * Abstract base class for listener-based server responses, e.g. Servlet 3.1 - * and Undertow. + * Abstract base class for listener-based server responses. * * @author Arjen Poutsma * @since 5.0 diff --git a/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractListenerWriteProcessor.java b/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractListenerWriteProcessor.java index 92d7b41846b..defd6d6302a 100644 --- a/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractListenerWriteProcessor.java +++ b/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractListenerWriteProcessor.java @@ -34,7 +34,7 @@ import org.springframework.util.StringUtils; * event-listener write APIs and Reactive Streams. * *

Specifically a base class for writing to the HTTP response body with - * Servlet 3.1 non-blocking I/O and Undertow XNIO as well for writing WebSocket + * Servlet non-blocking I/O and Undertow XNIO as well for writing WebSocket * messages through the Java WebSocket API (JSR-356), Jetty, and Undertow. * * @author Arjen Poutsma diff --git a/spring-web/src/main/java/org/springframework/http/server/reactive/ServletHttpHandlerAdapter.java b/spring-web/src/main/java/org/springframework/http/server/reactive/ServletHttpHandlerAdapter.java index 0fe306911e7..8918aa568f6 100644 --- a/spring-web/src/main/java/org/springframework/http/server/reactive/ServletHttpHandlerAdapter.java +++ b/spring-web/src/main/java/org/springframework/http/server/reactive/ServletHttpHandlerAdapter.java @@ -47,7 +47,7 @@ import org.springframework.util.Assert; /** * Adapt {@link HttpHandler} to an {@link HttpServlet} using Servlet Async support - * and Servlet 3.1 non-blocking I/O. + * and Servlet non-blocking I/O. * * @author Arjen Poutsma * @author Rossen Stoyanchev diff --git a/spring-web/src/main/java/org/springframework/http/server/reactive/package-info.java b/spring-web/src/main/java/org/springframework/http/server/reactive/package-info.java index f2025bc4932..25e89a1f036 100644 --- a/spring-web/src/main/java/org/springframework/http/server/reactive/package-info.java +++ b/spring-web/src/main/java/org/springframework/http/server/reactive/package-info.java @@ -5,7 +5,7 @@ * {@link org.springframework.http.server.reactive.HttpHandler} for processing. * *

Also provides implementations adapting to different runtimes - * including Servlet 3.1 containers, Netty + Reactor IO, and Undertow. + * including Servlet containers, Netty + Reactor IO, and Undertow. */ @NonNullApi @NonNullFields diff --git a/spring-web/src/main/java/org/springframework/web/SpringServletContainerInitializer.java b/spring-web/src/main/java/org/springframework/web/SpringServletContainerInitializer.java index 6ce5e8fa83f..3c0d69c46d8 100644 --- a/spring-web/src/main/java/org/springframework/web/SpringServletContainerInitializer.java +++ b/spring-web/src/main/java/org/springframework/web/SpringServletContainerInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,21 +33,18 @@ import org.springframework.lang.Nullable; import org.springframework.util.ReflectionUtils; /** - * Servlet 3.0 {@link ServletContainerInitializer} designed to support code-based + * A Spring-provided {@link ServletContainerInitializer} designed to support code-based * configuration of the servlet container using Spring's {@link WebApplicationInitializer} * SPI as opposed to (or possibly in combination with) the traditional * {@code web.xml}-based approach. * *

Mechanism of Operation

* This class will be loaded and instantiated and have its {@link #onStartup} - * method invoked by any Servlet 3.0-compliant container during container startup assuming + * method invoked by any Servlet-compliant container during container startup assuming * that the {@code spring-web} module JAR is present on the classpath. This occurs through * the JAR Services API {@link ServiceLoader#load(Class)} method detecting the * {@code spring-web} module's {@code META-INF/services/jakarta.servlet.ServletContainerInitializer} - * service provider configuration file. See the - * - * JAR Services API documentation as well as section 8.2.4 of the Servlet 3.0 - * Final Draft specification for complete details. + * service provider configuration file. * *

In combination with {@code web.xml}

* A web application can choose to limit the amount of classpath scanning the Servlet @@ -80,12 +77,12 @@ import org.springframework.util.ReflectionUtils; *

General Notes

* In general, this class should be viewed as supporting infrastructure for * the more important and user-facing {@code WebApplicationInitializer} SPI. Taking - * advantage of this container initializer is also completely optional: while - * it is true that this initializer will be loaded and invoked under all Servlet 3.0+ - * runtimes, it remains the user's choice whether to make any - * {@code WebApplicationInitializer} implementations available on the classpath. If no - * {@code WebApplicationInitializer} types are detected, this container initializer will - * have no effect. + * advantage of this container initializer is also completely optional: + * while it is true that this initializer will be loaded and invoked under all + * Servlet runtimes, it remains the user's choice whether to make any + * {@code WebApplicationInitializer} implementations available on the classpath. + * If no {@code WebApplicationInitializer} types are detected, this container + * initializer will have no effect. * *

Note that use of this container initializer and of {@code WebApplicationInitializer} * is not in any way "tied" to Spring MVC other than the fact that the types are shipped @@ -117,8 +114,8 @@ public class SpringServletContainerInitializer implements ServletContainerInitia * Delegate the {@code ServletContext} to any {@link WebApplicationInitializer} * implementations present on the application classpath. *

Because this class declares @{@code HandlesTypes(WebApplicationInitializer.class)}, - * Servlet 3.0+ containers will automatically scan the classpath for implementations - * of Spring's {@code WebApplicationInitializer} interface and provide the set of all + * Servlet containers will automatically scan the classpath for implementations of + * Spring's {@code WebApplicationInitializer} interface and provide the set of all * such types to the {@code webAppInitializerClasses} parameter of this method. *

If no {@code WebApplicationInitializer} implementations are found on the classpath, * this method is effectively a no-op. An INFO-level log message will be issued notifying diff --git a/spring-web/src/main/java/org/springframework/web/WebApplicationInitializer.java b/spring-web/src/main/java/org/springframework/web/WebApplicationInitializer.java index 736e5031a64..6ee0811cb8e 100644 --- a/spring-web/src/main/java/org/springframework/web/WebApplicationInitializer.java +++ b/spring-web/src/main/java/org/springframework/web/WebApplicationInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,13 +20,13 @@ import jakarta.servlet.ServletContext; import jakarta.servlet.ServletException; /** - * Interface to be implemented in Servlet 3.0+ environments in order to configure the + * Interface to be implemented in Servlet environments in order to configure the * {@link ServletContext} programmatically -- as opposed to (or possibly in conjunction * with) the traditional {@code web.xml}-based approach. * *

Implementations of this SPI will be detected automatically by {@link * SpringServletContainerInitializer}, which itself is bootstrapped automatically - * by any Servlet 3.0 container. See {@linkplain SpringServletContainerInitializer its + * by any Servlet container. See {@linkplain SpringServletContainerInitializer its * Javadoc} for details on this bootstrapping mechanism. * *

Example

@@ -74,10 +74,10 @@ import jakarta.servlet.ServletException; * As an alternative to the above, you can also extend from {@link * org.springframework.web.servlet.support.AbstractDispatcherServletInitializer}. * - * As you can see, thanks to Servlet 3.0's new {@link ServletContext#addServlet} method - * we're actually registering an instance of the {@code DispatcherServlet}, and - * this means that the {@code DispatcherServlet} can now be treated like any other object - * -- receiving constructor injection of its application context in this case. + * As you can see, thanks to the Servlet container's {@link ServletContext#addServlet} + * method we're actually registering an instance of the {@code DispatcherServlet}, + * and this means that the {@code DispatcherServlet} can now be treated like any other + * object -- receiving constructor injection of its application context in this case. * *

This style is both simpler and more concise. There is no concern for dealing with * init-params, etc, just normal JavaBean-style properties and constructor arguments. You @@ -89,8 +89,8 @@ import jakarta.servlet.ServletException; * {@code ContextLoaderListener} and {@code DelegatingFilterProxy} all now support * constructor arguments. Even if a component (e.g. non-Spring, other third party) has not * been specifically updated for use within {@code WebApplicationInitializers}, they still - * may be used in any case. The Servlet 3.0 {@code ServletContext} API allows for setting - * init-params, context-params, etc programmatically. + * may be used in any case. The {@code ServletContext} API allows for setting init-params, + * context-params, etc programmatically. * *

A 100% code-based approach to configuration

* In the example above, {@code WEB-INF/web.xml} was successfully replaced with code in @@ -149,24 +149,6 @@ import jakarta.servlet.ServletException; * occurs. Use of this feature is expected to be rare, as typical applications will likely * centralize all container initialization within a single {@code WebApplicationInitializer}. * - *

Caveats

- * - *

web.xml versioning

- *

{@code WEB-INF/web.xml} and {@code WebApplicationInitializer} use are not mutually - * exclusive; for example, web.xml can register one servlet, and a {@code - * WebApplicationInitializer} can register another. An initializer can even - * modify registrations performed in {@code web.xml} through methods such as - * {@link ServletContext#getServletRegistration(String)}. However, if - * {@code WEB-INF/web.xml} is present in the application, its {@code version} attribute - * must be set to "3.0" or greater, otherwise {@code ServletContainerInitializer} - * bootstrapping will be ignored by the servlet container. - * - *

Mapping to '/' under Tomcat

- *

Apache Tomcat maps its internal {@code DefaultServlet} to "/", and on Tomcat versions - * <= 7.0.14, this servlet mapping cannot be overridden programmatically. - * 7.0.15 fixes this issue. Overriding the "/" servlet mapping has also been tested - * successfully under GlassFish 3.1.

- * * @author Chris Beams * @since 3.1 * @see SpringServletContainerInitializer diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestPart.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestPart.java index b84f09ffd72..e7c576b73c2 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestPart.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestPart.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ import org.springframework.web.multipart.MultipartResolver; * *

Supported method argument types include {@link MultipartFile} in conjunction with * Spring's {@link MultipartResolver} abstraction, {@code jakarta.servlet.http.Part} in - * conjunction with Servlet 3.0 multipart requests, or otherwise for any other method + * conjunction with Servlet multipart requests, or otherwise for any other method * argument, the content of the part is passed through an {@link HttpMessageConverter} * taking into consideration the 'Content-Type' header of the request part. This is * analogous to what @{@link RequestBody} does to resolve an argument based on the diff --git a/spring-web/src/main/java/org/springframework/web/context/ContextLoader.java b/spring-web/src/main/java/org/springframework/web/context/ContextLoader.java index 45a4bb69a92..e7c3d8a0f41 100644 --- a/spring-web/src/main/java/org/springframework/web/context/ContextLoader.java +++ b/spring-web/src/main/java/org/springframework/web/context/ContextLoader.java @@ -72,7 +72,7 @@ import org.springframework.util.StringUtils; * *

As of Spring 3.1, {@code ContextLoader} supports injecting the root web * application context via the {@link #ContextLoader(WebApplicationContext)} - * constructor, allowing for programmatic configuration in Servlet 3.0+ environments. + * constructor, allowing for programmatic configuration in Servlet initializers. * See {@link org.springframework.web.WebApplicationInitializer} for usage examples. * * @author Juergen Hoeller @@ -193,9 +193,8 @@ public class ContextLoader { /** * Create a new {@code ContextLoader} with the given application context. This - * constructor is useful in Servlet 3.0+ environments where instance-based - * registration of listeners is possible through the {@link ServletContext#addListener} - * API. + * constructor is useful in Servlet initializers where instance-based registration + * of listeners is possible through the {@link ServletContext#addListener} API. *

The context may or may not yet be {@linkplain * ConfigurableApplicationContext#refresh() refreshed}. If it (a) is an implementation * of {@link ConfigurableWebApplicationContext} and (b) has not diff --git a/spring-web/src/main/java/org/springframework/web/context/ContextLoaderListener.java b/spring-web/src/main/java/org/springframework/web/context/ContextLoaderListener.java index 3f57d676453..62518ce8659 100644 --- a/spring-web/src/main/java/org/springframework/web/context/ContextLoaderListener.java +++ b/spring-web/src/main/java/org/springframework/web/context/ContextLoaderListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import jakarta.servlet.ServletContextListener; * *

As of Spring 3.1, {@code ContextLoaderListener} supports injecting the root web * application context via the {@link #ContextLoaderListener(WebApplicationContext)} - * constructor, allowing for programmatic configuration in Servlet 3.0+ environments. + * constructor, allowing for programmatic configuration in Servlet initializers. * See {@link org.springframework.web.WebApplicationInitializer} for usage examples. * * @author Juergen Hoeller @@ -58,9 +58,8 @@ public class ContextLoaderListener extends ContextLoader implements ServletConte /** * Create a new {@code ContextLoaderListener} with the given application context. This - * constructor is useful in Servlet 3.0+ environments where instance-based - * registration of listeners is possible through the {@link jakarta.servlet.ServletContext#addListener} - * API. + * constructor is useful in Servlet initializers where instance-based registration of + * listeners is possible through the {@link jakarta.servlet.ServletContext#addListener} API. *

The context may or may not yet be {@linkplain * org.springframework.context.ConfigurableApplicationContext#refresh() refreshed}. If it * (a) is an implementation of {@link ConfigurableWebApplicationContext} and diff --git a/spring-web/src/main/java/org/springframework/web/context/request/async/StandardServletAsyncWebRequest.java b/spring-web/src/main/java/org/springframework/web/context/request/async/StandardServletAsyncWebRequest.java index 395166f84e9..bc7c6ed7627 100644 --- a/spring-web/src/main/java/org/springframework/web/context/request/async/StandardServletAsyncWebRequest.java +++ b/spring-web/src/main/java/org/springframework/web/context/request/async/StandardServletAsyncWebRequest.java @@ -32,7 +32,7 @@ import org.springframework.util.Assert; import org.springframework.web.context.request.ServletWebRequest; /** - * A Servlet 3.0 implementation of {@link AsyncWebRequest}. + * A Servlet implementation of {@link AsyncWebRequest}. * *

The servlet and all filters involved in an async request must have async * support enabled using the Servlet API or by adding an diff --git a/spring-web/src/main/java/org/springframework/web/filter/DelegatingFilterProxy.java b/spring-web/src/main/java/org/springframework/web/filter/DelegatingFilterProxy.java index 8a85966ed35..96f773e7806 100644 --- a/spring-web/src/main/java/org/springframework/web/filter/DelegatingFilterProxy.java +++ b/spring-web/src/main/java/org/springframework/web/filter/DelegatingFilterProxy.java @@ -54,9 +54,9 @@ import org.springframework.web.context.support.WebApplicationContextUtils; * of the {@code Filter.init} and {@code Filter.destroy} lifecycle methods * on the target bean, letting the servlet container manage the filter lifecycle. * - *

As of Spring 3.1, {@code DelegatingFilterProxy} has been updated to optionally accept - * constructor parameters when using Servlet 3.0's instance-based filter registration - * methods, usually in conjunction with Spring 3.1's + *

As of Spring 3.1, {@code DelegatingFilterProxy} has been updated to optionally + * accept constructor parameters when using a Servlet container's instance-based filter + * registration methods, usually in conjunction with Spring's * {@link org.springframework.web.WebApplicationInitializer} SPI. These constructors allow * for providing the delegate Filter bean directly, or providing the application context * and bean name to fetch, avoiding the need to look up the application context from the @@ -100,8 +100,7 @@ public class DelegatingFilterProxy extends GenericFilterBean { /** - * Create a new {@code DelegatingFilterProxy}. For traditional (pre-Servlet 3.0) use - * in {@code web.xml}. + * Create a new {@code DelegatingFilterProxy}. For traditional use in {@code web.xml}. * @see #setTargetBeanName(String) */ public DelegatingFilterProxy() { @@ -111,8 +110,7 @@ public class DelegatingFilterProxy extends GenericFilterBean { * Create a new {@code DelegatingFilterProxy} with the given {@link Filter} delegate. * Bypasses entirely the need for interacting with a Spring application context, * specifying the {@linkplain #setTargetBeanName target bean name}, etc. - *

For use in Servlet 3.0+ environments where instance-based registration of - * filters is supported. + *

For use with instance-based registration of filters. * @param delegate the {@code Filter} instance that this proxy will delegate to and * manage the lifecycle for (must not be {@code null}). * @see #doFilter(ServletRequest, ServletResponse, FilterChain) @@ -130,9 +128,8 @@ public class DelegatingFilterProxy extends GenericFilterBean { * bean from the Spring {@code WebApplicationContext} found in the {@code ServletContext} * (either the 'root' application context or the context named by * {@link #setContextAttribute}). - *

For use in Servlet 3.0+ environments where instance-based registration of - * filters is supported. - *

The target bean must implement the standard Servlet Filter. + *

For use with instance-based registration of filters. + *

The target bean must implement the standard Servlet Filter interface. * @param targetBeanName name of the target filter bean to look up in the Spring * application context (must not be {@code null}). * @see #findWebApplicationContext() @@ -145,8 +142,7 @@ public class DelegatingFilterProxy extends GenericFilterBean { /** * Create a new {@code DelegatingFilterProxy} that will retrieve the named target * bean from the given Spring {@code WebApplicationContext}. - *

For use in Servlet 3.0+ environments where instance-based registration of - * filters is supported. + *

For use with instance-based registration of filters. *

The target bean must implement the standard Servlet Filter interface. *

The given {@code WebApplicationContext} may or may not be refreshed when passed * in. If it has not, and if the context implements {@link ConfigurableApplicationContext}, diff --git a/spring-web/src/main/java/org/springframework/web/filter/OncePerRequestFilter.java b/spring-web/src/main/java/org/springframework/web/filter/OncePerRequestFilter.java index 6f505363829..46d5163cc7c 100644 --- a/spring-web/src/main/java/org/springframework/web/filter/OncePerRequestFilter.java +++ b/spring-web/src/main/java/org/springframework/web/filter/OncePerRequestFilter.java @@ -35,7 +35,7 @@ import org.springframework.web.util.WebUtils; * dispatch, on any servlet container. It provides a {@link #doFilterInternal} * method with HttpServletRequest and HttpServletResponse arguments. * - *

As of Servlet 3.0, a filter may be invoked as part of a + *

A filter may be invoked as part of a * {@link jakarta.servlet.DispatcherType#REQUEST REQUEST} or * {@link jakarta.servlet.DispatcherType#ASYNC ASYNC} dispatches that occur in * separate threads. A filter can be configured in {@code web.xml} whether it @@ -133,10 +133,10 @@ public abstract class OncePerRequestFilter extends GenericFilterBean { } /** - * The dispatcher type {@code jakarta.servlet.DispatcherType.ASYNC} introduced - * in Servlet 3.0 means a filter can be invoked in more than one thread over - * the course of a single request. This method returns {@code true} if the - * filter is currently executing within an asynchronous dispatch. + * The dispatcher type {@code jakarta.servlet.DispatcherType.ASYNC} means a + * filter can be invoked in more than one thread over the course of a single + * request. This method returns {@code true} if the filter is currently + * executing within an asynchronous dispatch. * @param request the current request * @since 3.2 * @see WebAsyncManager#hasConcurrentResult() @@ -186,15 +186,15 @@ public abstract class OncePerRequestFilter extends GenericFilterBean { } /** - * The dispatcher type {@code jakarta.servlet.DispatcherType.ASYNC} introduced - * in Servlet 3.0 means a filter can be invoked in more than one thread - * over the course of a single request. Some filters only need to filter - * the initial thread (e.g. request wrapping) while others may need - * to be invoked at least once in each additional thread for example for - * setting up thread locals or to perform final processing at the very end. + * The dispatcher type {@code jakarta.servlet.DispatcherType.ASYNC} means a + * filter can be invoked in more than one thread over the course of a single + * request. Some filters only need to filter the initial thread (e.g. request + * wrapping) while others may need to be invoked at least once in each + * additional thread for example for setting up thread locals or to perform + * final processing at the very end. *

Note that although a filter can be mapped to handle specific dispatcher * types via {@code web.xml} or in Java through the {@code ServletContext}, - * servlet containers may enforce different defaults with regards to + * servlet containers may enforce different defaults with respect to * dispatcher types. This flag enforces the design intent of the filter. *

The default return value is "true", which means the filter will not be * invoked during subsequent async dispatches. If "false", the filter will diff --git a/spring-web/src/main/java/org/springframework/web/filter/ShallowEtagHeaderFilter.java b/spring-web/src/main/java/org/springframework/web/filter/ShallowEtagHeaderFilter.java index 06e164297f8..229beacf3ee 100644 --- a/spring-web/src/main/java/org/springframework/web/filter/ShallowEtagHeaderFilter.java +++ b/spring-web/src/main/java/org/springframework/web/filter/ShallowEtagHeaderFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,9 +46,6 @@ import org.springframework.web.util.WebUtils; * (e.g. a {@link org.springframework.web.servlet.View}) is still rendered. * As such, this filter only saves bandwidth, not server performance. * - *

NOTE: As of Spring Framework 5.0, this filter uses request/response - * decorators built on the Servlet 3.1 API. - * * @author Arjen Poutsma * @author Rossen Stoyanchev * @author Brian Clozel diff --git a/spring-web/src/main/java/org/springframework/web/method/annotation/RequestParamMethodArgumentResolver.java b/spring-web/src/main/java/org/springframework/web/method/annotation/RequestParamMethodArgumentResolver.java index ec1aeb1149d..265d8cae47a 100644 --- a/spring-web/src/main/java/org/springframework/web/method/annotation/RequestParamMethodArgumentResolver.java +++ b/spring-web/src/main/java/org/springframework/web/method/annotation/RequestParamMethodArgumentResolver.java @@ -53,7 +53,7 @@ import org.springframework.web.util.UriComponentsBuilder; * Resolves method arguments annotated with @{@link RequestParam}, arguments of * type {@link MultipartFile} in conjunction with Spring's {@link MultipartResolver} * abstraction, and arguments of type {@code jakarta.servlet.http.Part} in conjunction - * with Servlet 3.0 multipart requests. This resolver can also be created in default + * with Servlet multipart requests. This resolver can also be created in default * resolution mode in which simple types (int, long, etc.) not annotated with * {@link RequestParam @RequestParam} are also treated as request parameters with * the parameter name derived from the argument name. diff --git a/spring-web/src/main/java/org/springframework/web/multipart/MultipartFile.java b/spring-web/src/main/java/org/springframework/web/multipart/MultipartFile.java index 25790e5f3d1..90f41da86ec 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/MultipartFile.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/MultipartFile.java @@ -124,7 +124,7 @@ public interface MultipartFile extends InputStreamSource { * in order to work with any storage mechanism. *

NOTE: Depending on the underlying provider, temporary storage * may be container-dependent, including the base directory for relative - * destinations specified here (e.g. with Servlet 3.0 multipart handling). + * destinations specified here (e.g. with Servlet multipart handling). * For absolute destinations, the target file may get renamed/moved from its * temporary location or newly copied, even if a temporary copy already exists. * @param dest the destination file (typically absolute) diff --git a/spring-web/src/main/java/org/springframework/web/multipart/MultipartResolver.java b/spring-web/src/main/java/org/springframework/web/multipart/MultipartResolver.java index a9c79dfbb82..1c6ab839805 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/MultipartResolver.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/MultipartResolver.java @@ -27,7 +27,7 @@ import jakarta.servlet.http.HttpServletRequest; *

Spring provides the following concrete implementation: *

* *

There is no default resolver implementation used for Spring diff --git a/spring-web/src/main/java/org/springframework/web/multipart/support/MultipartFilter.java b/spring-web/src/main/java/org/springframework/web/multipart/support/MultipartFilter.java index 276c5a05e20..e1e799dcb7c 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/support/MultipartFilter.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/support/MultipartFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,8 +38,8 @@ import org.springframework.web.multipart.MultipartResolver; * the default bean name is "filterMultipartResolver". * *

If no MultipartResolver bean is found, this filter falls back to a default - * MultipartResolver: {@link StandardServletMultipartResolver} for Servlet 3.0, - * based on a multipart-config section in {@code web.xml}. + * MultipartResolver: {@link StandardServletMultipartResolver} for Servlet + * oontainers, based on a multipart-config section in {@code web.xml}. * Note however that at present the Servlet specification only defines how to * enable multipart configuration on a Servlet and as a result multipart request * processing is likely not possible in a Filter unless the Servlet container diff --git a/spring-web/src/main/java/org/springframework/web/multipart/support/RequestPartServletServerHttpRequest.java b/spring-web/src/main/java/org/springframework/web/multipart/support/RequestPartServletServerHttpRequest.java index aa1bfca3c3f..424ea4e1d6d 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/support/RequestPartServletServerHttpRequest.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/support/RequestPartServletServerHttpRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ import org.springframework.web.multipart.MultipartResolver; /** * {@link ServerHttpRequest} implementation that accesses one part of a multipart * request. If using {@link MultipartResolver} configuration the part is accessed - * through a {@link MultipartFile}. Or if using Servlet 3.0 multipart processing + * through a {@link MultipartFile}. Or if using Servlet multipart processing * the part is accessed through {@code ServletRequest.getPart}. * * @author Rossen Stoyanchev diff --git a/spring-web/src/main/java/org/springframework/web/multipart/support/StandardMultipartHttpServletRequest.java b/spring-web/src/main/java/org/springframework/web/multipart/support/StandardMultipartHttpServletRequest.java index 7f21e5e2775..dffdf4890a9 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/support/StandardMultipartHttpServletRequest.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/support/StandardMultipartHttpServletRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ import org.springframework.web.multipart.MultipartException; import org.springframework.web.multipart.MultipartFile; /** - * Spring MultipartHttpServletRequest adapter, wrapping a Servlet 3.0 HttpServletRequest + * Spring MultipartHttpServletRequest adapter, wrapping a Servlet HttpServletRequest * and its Part objects. Parameters get exposed through the native request's getParameter * methods - without any custom processing on our side. * @@ -138,7 +138,7 @@ public class StandardMultipartHttpServletRequest extends AbstractMultipartHttpSe return super.getParameterNames(); } - // Servlet 3.0 getParameterNames() not guaranteed to include multipart form items + // Servlet getParameterNames() not guaranteed to include multipart form items // (e.g. on WebLogic 12) -> need to merge them here to be on the safe side Set paramNames = new LinkedHashSet<>(); Enumeration paramEnum = super.getParameterNames(); @@ -158,7 +158,7 @@ public class StandardMultipartHttpServletRequest extends AbstractMultipartHttpSe return super.getParameterMap(); } - // Servlet 3.0 getParameterMap() not guaranteed to include multipart form items + // Servlet getParameterMap() not guaranteed to include multipart form items // (e.g. on WebLogic 12) -> need to merge them here to be on the safe side Map paramMap = new LinkedHashMap<>(super.getParameterMap()); for (String paramName : this.multipartParameterNames) { @@ -202,7 +202,7 @@ public class StandardMultipartHttpServletRequest extends AbstractMultipartHttpSe /** - * Spring MultipartFile adapter, wrapping a Servlet 3.0 Part object. + * Spring MultipartFile adapter, wrapping a Servlet Part object. */ @SuppressWarnings("serial") private static class StandardMultipartFile implements MultipartFile, Serializable { @@ -255,7 +255,7 @@ public class StandardMultipartHttpServletRequest extends AbstractMultipartHttpSe public void transferTo(File dest) throws IOException, IllegalStateException { this.part.write(dest.getPath()); if (dest.isAbsolute() && !dest.exists()) { - // Servlet 3.0 Part.write is not guaranteed to support absolute file paths: + // Servlet Part.write is not guaranteed to support absolute file paths: // may translate the given path to a relative location within a temp dir // (e.g. on Jetty whereas Tomcat and Undertow detect absolute paths). // At least we offloaded the file from memory storage; it'll get deleted diff --git a/spring-web/src/main/java/org/springframework/web/multipart/support/StandardServletMultipartResolver.java b/spring-web/src/main/java/org/springframework/web/multipart/support/StandardServletMultipartResolver.java index b09dac0ba20..7888b8bde0f 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/support/StandardServletMultipartResolver.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/support/StandardServletMultipartResolver.java @@ -28,7 +28,7 @@ import org.springframework.web.multipart.MultipartResolver; /** * Standard implementation of the {@link MultipartResolver} interface, - * based on the Servlet 3.0 {@link jakarta.servlet.http.Part} API. + * based on the Servlet {@link jakarta.servlet.http.Part} API. * To be added as "multipartResolver" bean to a Spring DispatcherServlet context, * without any extra configuration at the bean level (see below). * @@ -38,14 +38,14 @@ import org.springframework.web.multipart.MultipartResolver; * {@linkplain #setStrictServletCompliance strict Servlet compliance}, narrowing the * applicability of Spring's {@link MultipartHttpServletRequest} to form data only. * - *

Note: In order to use Servlet 3.0 based multipart parsing, + *

Note: In order to use Servlet container based multipart parsing, * you need to mark the affected servlet with a "multipart-config" section in * {@code web.xml}, or with a {@link jakarta.servlet.MultipartConfigElement} * in programmatic servlet registration, or (in case of a custom servlet class) * possibly with a {@link jakarta.servlet.annotation.MultipartConfig} annotation - * on your servlet class. Configuration settings such as maximum sizes or - * storage locations need to be applied at that servlet registration level; - * Servlet 3.0 does not allow for them to be set at the MultipartResolver level. + * on your servlet class. Configuration settings such as maximum sizes or storage + * locations need to be applied at that servlet registration level; a Servlet + * container does not allow for them to be set at the MultipartResolver level. * *

  * public class AppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
diff --git a/spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java b/spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java
index 64df59fb273..562ab5b1cca 100644
--- a/spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java
+++ b/spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java
@@ -46,8 +46,6 @@ import org.springframework.lang.Nullable;
  * retrieved via {@link #getContentAsByteArray()}.
  *
  * 

Used e.g. by {@link org.springframework.web.filter.AbstractRequestLoggingFilter}. - * Note: As of Spring Framework 5.0, this wrapper is built on the Servlet 3.1 API. - * * * @author Juergen Hoeller * @author Brian Clozel diff --git a/spring-web/src/main/java/org/springframework/web/util/ContentCachingResponseWrapper.java b/spring-web/src/main/java/org/springframework/web/util/ContentCachingResponseWrapper.java index d1de91db742..d7fdb0e0e21 100644 --- a/spring-web/src/main/java/org/springframework/web/util/ContentCachingResponseWrapper.java +++ b/spring-web/src/main/java/org/springframework/web/util/ContentCachingResponseWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,6 @@ import org.springframework.util.FastByteArrayOutputStream; * and allows this content to be retrieved via a {@link #getContentAsByteArray() byte array}. * *

Used e.g. by {@link org.springframework.web.filter.ShallowEtagHeaderFilter}. - * Note: As of Spring Framework 5.0, this wrapper is built on the Servlet 3.1 API. * * @author Juergen Hoeller * @since 4.1.3 @@ -128,7 +127,6 @@ public class ContentCachingResponseWrapper extends HttpServletResponseWrapper { this.contentLength = len; } - // Overrides Servlet 3.1 setContentLengthLong(long) at runtime @Override public void setContentLengthLong(long len) { if (len > Integer.MAX_VALUE) { diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctions.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctions.java index 30157153d4a..8e52bb25002 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctions.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctions.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,9 +50,9 @@ import org.springframework.web.util.pattern.PathPatternParser; * {@linkplain #nest(RequestPredicate, RouterFunction) subrouting} on an existing routing * function. * - *

Additionally, this class can {@linkplain #toHttpHandler(RouterFunction) transform} a - * {@code RouterFunction} into an {@code HttpHandler}, which can be run in Servlet 3.1+, - * Reactor, or Undertow. + *

Additionally, this class can {@linkplain #toHttpHandler(RouterFunction) transform} + * a {@code RouterFunction} into an {@code HttpHandler}, which can be run in Servlet + * environments, Reactor, or Undertow. * * @author Arjen Poutsma * @since 5.0 @@ -192,7 +192,7 @@ public abstract class RouterFunctions { * This conversion uses {@linkplain HandlerStrategies#builder() default strategies}. *

The returned handler can be adapted to run in *