diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java index 38f5c2f410c..cced791405e 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java +++ b/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2025 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. @@ -146,6 +146,12 @@ import org.springframework.core.Ordered; * compile-time weaving or load-time weaving applying the aspect to the affected classes. * There is no proxy involved in such a scenario; local calls will be intercepted as well. * + *
Note: {@code @EnableAsync} applies to its local application context only, + * allowing for selective activation at different levels. Please redeclare + * {@code @EnableAsync} in each individual context, for example, the common root web + * application context and any separate {@code DispatcherServlet} application contexts, + * if you need to apply its behavior at multiple levels. + * * @author Chris Beams * @author Juergen Hoeller * @author Stephane Nicoll diff --git a/spring-web/src/main/java/org/springframework/web/context/ConfigurableWebEnvironment.java b/spring-web/src/main/java/org/springframework/web/context/ConfigurableWebEnvironment.java index f1ed6ff1d28..a379a049b8e 100644 --- a/spring-web/src/main/java/org/springframework/web/context/ConfigurableWebEnvironment.java +++ b/spring-web/src/main/java/org/springframework/web/context/ConfigurableWebEnvironment.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2025 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. @@ -39,7 +39,7 @@ public interface ConfigurableWebEnvironment extends ConfigurableEnvironment { * org.springframework.core.env.PropertySource.StubPropertySource stub property source} * instances acting as placeholders with real servlet context/config property sources * using the given parameters. - * @param servletContext the {@link ServletContext} (may not be {@code null}) + * @param servletContext the {@link ServletContext} ({@code null} if not available) * @param servletConfig the {@link ServletConfig} ({@code null} if not available) * @see org.springframework.web.context.support.WebApplicationContextUtils#initServletPropertySources( * org.springframework.core.env.MutablePropertySources, ServletContext, ServletConfig)