Stop referring to "Spring 3.x" features in documentation and code

This commit is contained in:
Sam Brannen 2023-01-20 11:44:34 +01:00
parent 8f94c4e933
commit 24f18275dd
39 changed files with 225 additions and 238 deletions

View File

@ -1100,12 +1100,15 @@ subclass is used to implement the Decorator pattern, weaving in the advice.
CGLIB proxying should generally be transparent to users. However, there are some issues CGLIB proxying should generally be transparent to users. However, there are some issues
to consider: to consider:
* `Final` methods cannot be advised, as they cannot be overridden. * `final` classes cannot be proxied, because they cannot be extended.
* There is no need to add CGLIB to your classpath. As of Spring 3.2, CGLIB is repackaged * `final` methods cannot be advised, because they cannot be overridden.
and included in the spring-core JAR. In other words, CGLIB-based AOP works "`out of * `private` methods cannot be advised, because they cannot be overridden.
the box`", as do JDK dynamic proxies.
There is little performance difference between CGLIB proxying and dynamic proxies. NOTE: There is no need to add CGLIB to your classpath. CGLIB is repackaged and included
in the `spring-core` JAR. In other words, CGLIB-based AOP works "out of the box", as do
JDK dynamic proxies.
There is little performance difference between CGLIB proxies and dynamic proxies.
Performance should not be a decisive consideration in this case. Performance should not be a decisive consideration in this case.

View File

@ -524,15 +524,13 @@ container that hosts the bean. A bean usually has only one identifier. However,
requires more than one, the extra ones can be considered aliases. requires more than one, the extra ones can be considered aliases.
In XML-based configuration metadata, you use the `id` attribute, the `name` attribute, or In XML-based configuration metadata, you use the `id` attribute, the `name` attribute, or
both to specify the bean identifiers. The `id` attribute lets you specify both to specify bean identifiers. The `id` attribute lets you specify exactly one `id`.
exactly one id. Conventionally, these names are alphanumeric ('myBean', Conventionally, these names are alphanumeric ('myBean', 'someService', etc.), but they
'someService', etc.), but they can contain special characters as well. If you want to can contain special characters as well. If you want to introduce other aliases for the
introduce other aliases for the bean, you can also specify them in the `name` bean, you can also specify them in the `name` attribute, separated by a comma (`,`),
attribute, separated by a comma (`,`), semicolon (`;`), or white space. As a semicolon (`;`), or white space. Although the `id` attribute is defined as an
historical note, in versions prior to Spring 3.1, the `id` attribute was `xsd:string` type, bean `id` uniqueness is enforced by the container, though not by XML
defined as an `xsd:ID` type, which constrained possible characters. As of 3.1, parsers.
it is defined as an `xsd:string` type. Note that bean `id` uniqueness is still
enforced by the container, though no longer by XML parsers.
You are not required to supply a `name` or an `id` for a bean. If you do not supply a You are not required to supply a `name` or an `id` for a bean. If you do not supply a
`name` or `id` explicitly, the container generates a unique name for that bean. However, `name` or `id` explicitly, the container generates a unique name for that bean. However,
@ -2704,8 +2702,8 @@ The following table describes the supported scopes:
the context of a web-aware Spring `ApplicationContext`. the context of a web-aware Spring `ApplicationContext`.
|=== |===
NOTE: As of Spring 3.0, a thread scope is available but is not registered by default. For NOTE: A thread scope is available but is not registered by default. For more information,
more information, see the documentation for see the documentation for
{api-spring-framework}/context/support/SimpleThreadScope.html[`SimpleThreadScope`]. {api-spring-framework}/context/support/SimpleThreadScope.html[`SimpleThreadScope`].
For instructions on how to register this or any other custom scope, see For instructions on how to register this or any other custom scope, see
<<beans-factory-scopes-custom-using>>. <<beans-factory-scopes-custom-using>>.
@ -4590,26 +4588,24 @@ configuration becomes decentralized and harder to control.
No matter the choice, Spring can accommodate both styles and even mix them together. No matter the choice, Spring can accommodate both styles and even mix them together.
It is worth pointing out that through its <<beans-java, JavaConfig>> option, Spring lets It is worth pointing out that through its <<beans-java, JavaConfig>> option, Spring lets
annotations be used in a non-invasive way, without touching the target components annotations be used in a non-invasive way, without touching the target components'
source code and that, in terms of tooling, all configuration styles are supported by the source code and that, in terms of tooling, all configuration styles are supported by
https://spring.io/tools[Spring Tools for Eclipse]. https://spring.io/tools[Spring Tools] for Eclipse, Visual Studio Code, and Theia.
**** ****
An alternative to XML setup is provided by annotation-based configuration, which relies An alternative to XML setup is provided by annotation-based configuration, which relies
on the bytecode metadata for wiring up components instead of angle-bracket declarations. on bytecode metadata for wiring up components instead of XML declarations. Instead of
Instead of using XML to describe a bean wiring, the developer moves the configuration using XML to describe a bean wiring, the developer moves the configuration into the
into the component class itself by using annotations on the relevant class, method, or component class itself by using annotations on the relevant class, method, or field
field declaration. As mentioned in <<beans-factory-extension-bpp-examples-aabpp>>, using declaration. As mentioned in <<beans-factory-extension-bpp-examples-aabpp>>, using a
a `BeanPostProcessor` in conjunction with annotations is a common means of extending the `BeanPostProcessor` in conjunction with annotations is a common means of extending the
Spring IoC container. For example, Spring 2.5 introduced an annotation-based approach to Spring IoC container. For example, the <<beans-autowired-annotation, `@Autowired`>>
drive Spring's dependency injection. Essentially, the <<beans-autowired-annotation, annotation provides the same capabilities as described in <<beans-factory-autowire>> but
`@Autowired`>> annotation provides the same capabilities as described in with more fine-grained control and wider applicability. In addition, Spring provides
<<beans-factory-autowire>> but with more fine-grained control and wider applicability. support for JSR-250 annotations, such as `@PostConstruct` and `@PreDestroy`, as well as
Spring 2.5 also added support for JSR-250 annotations, such as `@PostConstruct` and support for JSR-330 (Dependency Injection for Java) annotations contained in the
`@PreDestroy`. Spring 3.0 added support for JSR-330 (Dependency Injection for Java) `jakarta.inject` package such as `@Inject` and `@Named`. Details about those annotations
annotations contained in the `jakarta.inject` package such as `@Inject` and `@Named`. can be found in the <<beans-standard-annotations, relevant section>>.
Details about those annotations can be found in the <<beans-standard-annotations,
relevant section>>.
[NOTE] [NOTE]
==== ====
@ -6237,7 +6233,7 @@ simply to be added to the application's classpath like any other library.
Most examples in this chapter use XML to specify the configuration metadata that produces Most examples in this chapter use XML to specify the configuration metadata that produces
each `BeanDefinition` within the Spring container. The previous section each `BeanDefinition` within the Spring container. The previous section
(<<beans-annotation-config>>) demonstrates how to provide a lot of the configuration (<<beans-annotation-config>>) demonstrates how to provide a lot of the configuration
metadata through source-level annotations. Even in those examples, however, the "`base`" metadata through source-level annotations. Even in those examples, however, the "base"
bean definitions are explicitly defined in the XML file, while the annotations drive only bean definitions are explicitly defined in the XML file, while the annotations drive only
the dependency injection. This section describes an option for implicitly detecting the the dependency injection. This section describes an option for implicitly detecting the
candidate components by scanning the classpath. Candidate components are classes that candidate components by scanning the classpath. Candidate components are classes that
@ -6249,10 +6245,9 @@ the container.
[NOTE] [NOTE]
==== ====
Starting with Spring 3.0, many features provided by the Spring JavaConfig project are You can define beans using Java rather than using XML files. Take a look at the
part of the core Spring Framework. This allows you to define beans using Java rather `@Configuration`, `@Bean`, `@Import`, and `@DependsOn` annotations for examples of how to
than using the traditional XML files. Take a look at the `@Configuration`, `@Bean`, use these features.
`@Import`, and `@DependsOn` annotations for examples of how to use these new features.
==== ====
@ -7172,9 +7167,9 @@ arrangement (as though no index were present at all) by setting `spring.index.ig
[[beans-standard-annotations]] [[beans-standard-annotations]]
== Using JSR 330 Standard Annotations == Using JSR 330 Standard Annotations
Starting with Spring 3.0, Spring offers support for JSR-330 standard annotations Spring offers support for JSR-330 standard annotations (Dependency Injection). Those
(Dependency Injection). Those annotations are scanned in the same way as the Spring annotations are scanned in the same way as the Spring annotations. To use them, you need
annotations. To use them, you need to have the relevant jars in your classpath. to have the relevant jars in your classpath.
[NOTE] [NOTE]
===== =====
@ -8611,22 +8606,24 @@ about singletons here.
[NOTE] [NOTE]
==== ====
As of Spring 3.2, it is no longer necessary to add CGLIB to your classpath because CGLIB It is not necessary to add CGLIB to your classpath because CGLIB classes are repackaged
classes have been repackaged under `org.springframework.cglib` and included directly under the `org.springframework.cglib` package and included directly within the
within the spring-core JAR. `spring-core` JAR.
==== ====
[TIP] [TIP]
==== ====
There are a few restrictions due to the fact that CGLIB dynamically adds features at There are a few restrictions due to the fact that CGLIB dynamically adds features at
startup-time. In particular, configuration classes must not be final. However, as startup-time. In particular, configuration classes must not be final. However, any
of 4.3, any constructors are allowed on configuration classes, including the use of constructors are allowed on configuration classes, including the use of `@Autowired` or a
`@Autowired` or a single non-default constructor declaration for default injection. single non-default constructor declaration for default injection.
If you prefer to avoid any CGLIB-imposed limitations, consider declaring your `@Bean` If you prefer to avoid any CGLIB-imposed limitations, consider declaring your `@Bean`
methods on non-`@Configuration` classes (for example, on plain `@Component` classes instead). methods on non-`@Configuration` classes (for example, on plain `@Component` classes
Cross-method calls between `@Bean` methods are not then intercepted, so you have instead) or by annotating your configuration class with
to exclusively rely on dependency injection at the constructor or method level there. `@Configuration(proxyBeanMethods = false)`. Cross-method calls between `@Bean` methods
are then not intercepted, so you have to exclusively rely on dependency injection at the
constructor or method level there.
==== ====

View File

@ -2,7 +2,7 @@
= Validation, Data Binding, and Type Conversion = Validation, Data Binding, and Type Conversion
There are pros and cons for considering validation as business logic, and Spring offers There are pros and cons for considering validation as business logic, and Spring offers
a design for validation (and data binding) that does not exclude either one of them. a design for validation and data binding that does not exclude either one of them.
Specifically, validation should not be tied to the web tier and should be easy to localize, Specifically, validation should not be tied to the web tier and should be easy to localize,
and it should be possible to plug in any available validator. Considering these concerns, and it should be possible to plug in any available validator. Considering these concerns,
Spring provides a `Validator` contract that is both basic and eminently usable Spring provides a `Validator` contract that is both basic and eminently usable
@ -15,18 +15,18 @@ provides the aptly named `DataBinder` to do exactly that. The `Validator` and th
limited to the web layer. limited to the web layer.
The `BeanWrapper` is a fundamental concept in the Spring Framework and is used in a lot The `BeanWrapper` is a fundamental concept in the Spring Framework and is used in a lot
of places. However, you probably do not need to use the `BeanWrapper` of places. However, you probably do not need to use the `BeanWrapper` directly. Because
directly. Because this is reference documentation, however, we felt that some explanation this is reference documentation, however, we feel that some explanation might be in
might be in order. We explain the `BeanWrapper` in this chapter, since, if you are order. We explain the `BeanWrapper` in this chapter, since, if you are going to use it at
going to use it at all, you are most likely do so when trying to bind data to objects. all, you are most likely do so when trying to bind data to objects.
Spring's `DataBinder` and the lower-level `BeanWrapper` both use `PropertyEditorSupport` Spring's `DataBinder` and the lower-level `BeanWrapper` both use `PropertyEditorSupport`
implementations to parse and format property values. The `PropertyEditor` and implementations to parse and format property values. The `PropertyEditor` and
`PropertyEditorSupport` types are part of the JavaBeans specification and are also `PropertyEditorSupport` types are part of the JavaBeans specification and are also
explained in this chapter. Spring 3 introduced a `core.convert` package that provides a explained in this chapter. Spring's `core.convert` package provides a general type
general type conversion facility, as well as a higher-level "`format`" package for conversion facility, as well as a higher-level `format` package for formatting UI field
formatting UI field values. You can use these packages as simpler alternatives to values. You can use these packages as simpler alternatives to `PropertyEditorSupport`
`PropertyEditorSupport` implementations. They are also discussed in this chapter. implementations. They are also discussed in this chapter.
Spring supports Java Bean Validation through setup infrastructure and an adaptor to Spring supports Java Bean Validation through setup infrastructure and an adaptor to
Spring's own `Validator` contract. Applications can enable Bean Validation once globally, Spring's own `Validator` contract. Applications can enable Bean Validation once globally,
@ -861,12 +861,12 @@ as needed.
[[core-convert]] [[core-convert]]
== Spring Type Conversion == Spring Type Conversion
Spring 3 introduced a `core.convert` package that provides a general type conversion The `core.convert` package provides a general type conversion system. The system defines
system. The system defines an SPI to implement type conversion logic and an API an SPI to implement type conversion logic and an API to perform type conversions at
to perform type conversions at runtime. Within a Spring container, you can use this system runtime. Within a Spring container, you can use this system as an alternative to
as an alternative to `PropertyEditor` implementations to convert externalized bean property value `PropertyEditor` implementations to convert externalized bean property value strings to
strings to the required property types. You can also use the public API anywhere in your the required property types. You can also use the public API anywhere in your application
application where type conversion is needed. where type conversion is needed.
@ -1205,8 +1205,9 @@ web or desktop application. In such environments, you typically convert from `St
to support the client postback process, as well as back to `String` to support the to support the client postback process, as well as back to `String` to support the
view rendering process. In addition, you often need to localize `String` values. The more view rendering process. In addition, you often need to localize `String` values. The more
general `core.convert` `Converter` SPI does not address such formatting requirements general `core.convert` `Converter` SPI does not address such formatting requirements
directly. To directly address them, Spring 3 introduced a convenient `Formatter` SPI that directly. To directly address them, Spring provides a convenient `Formatter` SPI that
provides a simple and robust alternative to `PropertyEditor` implementations for client environments. provides a simple and robust alternative to `PropertyEditor` implementations for client
environments.
In general, you can use the `Converter` SPI when you need to implement general-purpose type In general, you can use the `Converter` SPI when you need to implement general-purpose type
conversion logic -- for example, for converting between a `java.util.Date` and a `Long`. conversion logic -- for example, for converting between a `java.util.Date` and a `Long`.
@ -1956,9 +1957,9 @@ javadoc for more information on these options.
[[validation-binder]] [[validation-binder]]
=== Configuring a `DataBinder` === Configuring a `DataBinder`
Since Spring 3, you can configure a `DataBinder` instance with a `Validator`. Once You can configure a `DataBinder` instance with a `Validator`. Once configured, you can
configured, you can invoke the `Validator` by calling `binder.validate()`. Any validation invoke the `Validator` by calling `binder.validate()`. Any validation `Errors` are
`Errors` are automatically added to the binder's `BindingResult`. automatically added to the binder's `BindingResult`.
The following example shows how to use a `DataBinder` programmatically to invoke validation The following example shows how to use a `DataBinder` programmatically to invoke validation
logic after binding to a target object: logic after binding to a target object:

View File

@ -136,14 +136,16 @@ To configure the rules that the `TaskExecutor` uses, we expose simple bean prope
[[scheduling-task-scheduler]] [[scheduling-task-scheduler]]
== The Spring `TaskScheduler` Abstraction == The Spring `TaskScheduler` Abstraction
In addition to the `TaskExecutor` abstraction, Spring 3.0 introduced a `TaskScheduler` In addition to the `TaskExecutor` abstraction, Spring has a `TaskScheduler` SPI with a
with a variety of methods for scheduling tasks to run at some point in the future. variety of methods for scheduling tasks to run at some point in the future. The following
The following listing shows the `TaskScheduler` interface definition: listing shows the `TaskScheduler` interface definition:
[source,java,indent=0,subs="verbatim,quotes"] [source,java,indent=0,subs="verbatim,quotes"]
---- ----
public interface TaskScheduler { public interface TaskScheduler {
Clock getClock();
ScheduledFuture schedule(Runnable task, Trigger trigger); ScheduledFuture schedule(Runnable task, Trigger trigger);
ScheduledFuture schedule(Runnable task, Instant startTime); ScheduledFuture schedule(Runnable task, Instant startTime);
@ -168,12 +170,11 @@ much more flexible.
[[scheduling-trigger-interface]] [[scheduling-trigger-interface]]
=== `Trigger` Interface === `Trigger` Interface
The `Trigger` interface is essentially inspired by JSR-236 which, as of Spring 3.0, The `Trigger` interface is essentially inspired by JSR-236. The basic idea of the
was not yet officially implemented. The basic idea of the `Trigger` is that execution `Trigger` is that execution times may be determined based on past execution outcomes or
times may be determined based on past execution outcomes or even arbitrary conditions. even arbitrary conditions. If these determinations take into account the outcome of the
If these determinations take into account the outcome of the preceding execution, preceding execution, that information is available within a `TriggerContext`. The
that information is available within a `TriggerContext`. The `Trigger` interface itself `Trigger` interface itself is quite simple, as the following listing shows:
is quite simple, as the following listing shows:
[source,java,indent=0,subs="verbatim,quotes"] [source,java,indent=0,subs="verbatim,quotes"]
---- ----
@ -192,6 +193,8 @@ default). The following listing shows the available methods for `Trigger` implem
---- ----
public interface TriggerContext { public interface TriggerContext {
Clock getClock();
Instant lastScheduledExecution(); Instant lastScheduledExecution();
Instant lastActualExecution(); Instant lastActualExecution();

View File

@ -54,9 +54,9 @@ import org.springframework.util.ClassUtils;
* return type however, such exceptions cannot be transmitted back. In that case an * return type however, such exceptions cannot be transmitted back. In that case an
* {@link AsyncUncaughtExceptionHandler} can be registered to process such exceptions. * {@link AsyncUncaughtExceptionHandler} can be registered to process such exceptions.
* *
* <p>As of Spring 3.1.2 the {@code AnnotationAsyncExecutionInterceptor} subclass is * <p>Note: the {@code AnnotationAsyncExecutionInterceptor} subclass is preferred
* preferred for use due to its support for executor qualification in conjunction with * due to its support for executor qualification in conjunction with Spring's
* Spring's {@code @Async} annotation. * {@code @Async} annotation.
* *
* @author Juergen Hoeller * @author Juergen Hoeller
* @author Chris Beams * @author Chris Beams
@ -71,8 +71,8 @@ public class AsyncExecutionInterceptor extends AsyncExecutionAspectSupport imple
/** /**
* Create a new instance with a default {@link AsyncUncaughtExceptionHandler}. * Create a new instance with a default {@link AsyncUncaughtExceptionHandler}.
* @param defaultExecutor the {@link Executor} (typically a Spring {@link AsyncTaskExecutor} * @param defaultExecutor the {@link Executor} (typically a Spring {@link AsyncTaskExecutor}
* or {@link java.util.concurrent.ExecutorService}) to delegate to; * or {@link java.util.concurrent.ExecutorService}) to delegate to; a local
* as of 4.2.6, a local executor for this interceptor will be built otherwise * executor for this interceptor will be built otherwise
*/ */
public AsyncExecutionInterceptor(@Nullable Executor defaultExecutor) { public AsyncExecutionInterceptor(@Nullable Executor defaultExecutor) {
super(defaultExecutor); super(defaultExecutor);
@ -81,8 +81,8 @@ public class AsyncExecutionInterceptor extends AsyncExecutionAspectSupport imple
/** /**
* Create a new {@code AsyncExecutionInterceptor}. * Create a new {@code AsyncExecutionInterceptor}.
* @param defaultExecutor the {@link Executor} (typically a Spring {@link AsyncTaskExecutor} * @param defaultExecutor the {@link Executor} (typically a Spring {@link AsyncTaskExecutor}
* or {@link java.util.concurrent.ExecutorService}) to delegate to; * or {@link java.util.concurrent.ExecutorService}) to delegate to; a local
* as of 4.2.6, a local executor for this interceptor will be built otherwise * executor for this interceptor will be built otherwise
* @param exceptionHandler the {@link AsyncUncaughtExceptionHandler} to use * @param exceptionHandler the {@link AsyncUncaughtExceptionHandler} to use
*/ */
public AsyncExecutionInterceptor(@Nullable Executor defaultExecutor, AsyncUncaughtExceptionHandler exceptionHandler) { public AsyncExecutionInterceptor(@Nullable Executor defaultExecutor, AsyncUncaughtExceptionHandler exceptionHandler) {
@ -130,9 +130,12 @@ public class AsyncExecutionInterceptor extends AsyncExecutionAspectSupport imple
} }
/** /**
* This implementation is a no-op for compatibility in Spring 3.1.2. * Get the qualifier for a specific executor to use when executing the given
* Subclasses may override to provide support for extracting qualifier information, * method.
* e.g. via an annotation on the given method. * <p>The default implementation of this method is effectively a no-op.
* <p>Subclasses may override this method to provide support for extracting
* qualifier information &mdash; for example, via an annotation on the given
* method.
* @return always {@code null} * @return always {@code null}
* @since 3.1.2 * @since 3.1.2
* @see #determineAsyncExecutor(Method) * @see #determineAsyncExecutor(Method)

View File

@ -34,7 +34,7 @@ import org.springframework.lang.Nullable;
public interface ConfigurablePropertyAccessor extends PropertyAccessor, PropertyEditorRegistry, TypeConverter { public interface ConfigurablePropertyAccessor extends PropertyAccessor, PropertyEditorRegistry, TypeConverter {
/** /**
* Specify a Spring 3.0 ConversionService to use for converting * Specify a {@link ConversionService} to use for converting
* property values, as an alternative to JavaBeans PropertyEditors. * property values, as an alternative to JavaBeans PropertyEditors.
*/ */
void setConversionService(@Nullable ConversionService conversionService); void setConversionService(@Nullable ConversionService conversionService);

View File

@ -184,8 +184,8 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
/** /**
* Overloaded version of {@code addPropertyValue} that takes * Overloaded version of {@code addPropertyValue} that takes
* a property name and a property value. * a property name and a property value.
* <p>Note: As of Spring 3.0, we recommend using the more concise * <p>Note: we recommend using the more concise and chaining-capable variant
* and chaining-capable variant {@link #add}. * {@link #add(String, Object)}.
* @param propertyName name of the property * @param propertyName name of the property
* @param propertyValue value of the property * @param propertyValue value of the property
* @see #addPropertyValue(PropertyValue) * @see #addPropertyValue(PropertyValue)

View File

@ -116,7 +116,7 @@ public class PropertyEditorRegistrySupport implements PropertyEditorRegistry {
/** /**
* Specify a Spring 3.0 ConversionService to use for converting * Specify a {@link ConversionService} to use for converting
* property values, as an alternative to JavaBeans PropertyEditors. * property values, as an alternative to JavaBeans PropertyEditors.
*/ */
public void setConversionService(@Nullable ConversionService conversionService) { public void setConversionService(@Nullable ConversionService conversionService) {

View File

@ -147,7 +147,7 @@ public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single
BeanExpressionResolver getBeanExpressionResolver(); BeanExpressionResolver getBeanExpressionResolver();
/** /**
* Specify a Spring 3.0 ConversionService to use for converting * Specify a {@link ConversionService} to use for converting
* property values, as an alternative to JavaBeans PropertyEditors. * property values, as an alternative to JavaBeans PropertyEditors.
* @since 3.0 * @since 3.0
*/ */

View File

@ -232,10 +232,10 @@ public abstract class PlaceholderConfigurerSupport extends PropertyResourceConfi
} }
} }
// New in Spring 2.5: resolve placeholders in alias target names and aliases as well. // Resolve placeholders in alias target names and aliases as well.
beanFactoryToProcess.resolveAliases(valueResolver); beanFactoryToProcess.resolveAliases(valueResolver);
// New in Spring 3.0: resolve placeholders in embedded values such as annotation attributes. // Resolve placeholders in embedded values such as annotation attributes.
beanFactoryToProcess.addEmbeddedValueResolver(valueResolver); beanFactoryToProcess.addEmbeddedValueResolver(valueResolver);
} }

View File

@ -26,11 +26,11 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatException; import static org.assertj.core.api.Assertions.assertThatException;
/** /**
* With Spring 3.1, bean id attributes (and all other id attributes across the * Bean id attributes (and all other id attributes across the core schemas) are
* core schemas) are no longer typed as xsd:id, but as xsd:string. This allows * not typed as xsd:id, but as xsd:string. This allows for using the same bean
* for using the same bean id within nested &lt;beans&gt; elements. * id within nested &lt;beans&gt; elements.
* *
* Duplicate ids *within the same level of nesting* will still be treated as an * <p>Duplicate IDs *within the same level of nesting* will still be treated as an
* error through the ProblemReporter, as this could never be an intended/valid * error through the ProblemReporter, as this could never be an intended/valid
* situation. * situation.
* *

View File

@ -22,13 +22,13 @@ import java.util.function.Consumer;
/** /**
* Interface to be implemented by application event listeners. * Interface to be implemented by application event listeners.
* *
* <p>Based on the standard {@code java.util.EventListener} interface * <p>Based on the standard {@link java.util.EventListener} interface for the
* for the Observer design pattern. * Observer design pattern.
* *
* <p>As of Spring 3.0, an {@code ApplicationListener} can generically declare * <p>An {@code ApplicationListener} can generically declare the event type that
* the event type that it is interested in. When registered with a Spring * it is interested in. When registered with a Spring {@code ApplicationContext},
* {@code ApplicationContext}, events will be filtered accordingly, with the * events will be filtered accordingly, with the listener getting invoked for
* listener getting invoked for matching event objects only. * matching event objects only.
* *
* @author Rod Johnson * @author Rod Johnson
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -41,10 +41,9 @@ class PropertyPlaceholderBeanDefinitionParser extends AbstractPropertyLoadingBea
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
protected Class<?> getBeanClass(Element element) { protected Class<?> getBeanClass(Element element) {
// As of Spring 3.1, the default value of system-properties-mode has changed from // The default value of system-properties-mode is 'ENVIRONMENT'. This value
// 'FALLBACK' to 'ENVIRONMENT'. This latter value indicates that resolution of // indicates that resolution of placeholders against system properties is a
// placeholders against system properties is a function of the Environment and // function of the Environment and its current set of PropertySources.
// its current set of PropertySources.
if (SYSTEM_PROPERTIES_MODE_DEFAULT.equals(element.getAttribute(SYSTEM_PROPERTIES_MODE_ATTRIBUTE))) { if (SYSTEM_PROPERTIES_MODE_DEFAULT.equals(element.getAttribute(SYSTEM_PROPERTIES_MODE_ATTRIBUTE))) {
return PropertySourcesPlaceholderConfigurer.class; return PropertySourcesPlaceholderConfigurer.class;
} }

View File

@ -26,13 +26,6 @@ import org.springframework.core.task.AsyncTaskExecutor;
* {@link Runnable Runnables} that match the exposed preferences * {@link Runnable Runnables} that match the exposed preferences
* of the {@code TaskExecutor} implementation in use. * of the {@code TaskExecutor} implementation in use.
* *
* <p>Note: {@link SchedulingTaskExecutor} implementations are encouraged to also
* implement the {@link org.springframework.core.task.AsyncListenableTaskExecutor}
* interface. This is not required due to the dependency on Spring 4.0's
* {@link org.springframework.util.concurrent.ListenableFuture} interface,
* which would make it impossible for third-party executor implementations
* to remain compatible with both Spring 4.0 and Spring 3.x.
*
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 2.0 * @since 2.0
* @see SchedulingAwareRunnable * @see SchedulingAwareRunnable
@ -43,7 +36,7 @@ public interface SchedulingTaskExecutor extends AsyncTaskExecutor {
/** /**
* Does this {@code TaskExecutor} prefer short-lived tasks over long-lived tasks? * Does this {@code TaskExecutor} prefer short-lived tasks over long-lived tasks?
* <p>A {@code SchedulingTaskExecutor} implementation can indicate whether it * <p>A {@code SchedulingTaskExecutor} implementation can indicate whether it
* prefers submitted tasks to perform as little work as they can within a single * prefers submitted tasks to perform as little work as it can within a single
* task execution. For example, submitted tasks might break a repeated loop into * task execution. For example, submitted tasks might break a repeated loop into
* individual subtasks which submit a follow-up task afterwards (if feasible). * individual subtasks which submit a follow-up task afterwards (if feasible).
* <p>This should be considered a hint. Of course {@code TaskExecutor} clients * <p>This should be considered a hint. Of course {@code TaskExecutor} clients

View File

@ -26,9 +26,12 @@ import org.springframework.lang.Nullable;
/** /**
* Specialization of {@link AsyncExecutionInterceptor} that delegates method execution to * Specialization of {@link AsyncExecutionInterceptor} that delegates method execution to
* an {@code Executor} based on the {@link Async} annotation. Specifically designed to * an {@code Executor} based on the {@link Async} annotation.
* support use of {@link Async#value()} executor qualification mechanism introduced in *
* Spring 3.1.2. Supports detecting qualifier metadata via {@code @Async} at the method or * <p>Specifically designed to support use of the {@link Async#value()} executor
* qualifier mechanism.
*
* <p>Supports detecting qualifier metadata via {@code @Async} at the method or
* declaring class level. See {@link #getExecutorQualifier(Method)} for details. * declaring class level. See {@link #getExecutorQualifier(Method)} for details.
* *
* @author Chris Beams * @author Chris Beams
@ -44,7 +47,7 @@ public class AnnotationAsyncExecutionInterceptor extends AsyncExecutionIntercept
* and a simple {@link AsyncUncaughtExceptionHandler}. * and a simple {@link AsyncUncaughtExceptionHandler}.
* @param defaultExecutor the executor to be used by default if no more specific * @param defaultExecutor the executor to be used by default if no more specific
* executor has been qualified at the method level using {@link Async#value()}; * executor has been qualified at the method level using {@link Async#value()};
* as of 4.2.6, a local executor for this interceptor will be built otherwise * a local executor for this interceptor will be built otherwise
*/ */
public AnnotationAsyncExecutionInterceptor(@Nullable Executor defaultExecutor) { public AnnotationAsyncExecutionInterceptor(@Nullable Executor defaultExecutor) {
super(defaultExecutor); super(defaultExecutor);
@ -54,7 +57,7 @@ public class AnnotationAsyncExecutionInterceptor extends AsyncExecutionIntercept
* Create a new {@code AnnotationAsyncExecutionInterceptor} with the given executor. * Create a new {@code AnnotationAsyncExecutionInterceptor} with the given executor.
* @param defaultExecutor the executor to be used by default if no more specific * @param defaultExecutor the executor to be used by default if no more specific
* executor has been qualified at the method level using {@link Async#value()}; * executor has been qualified at the method level using {@link Async#value()};
* as of 4.2.6, a local executor for this interceptor will be built otherwise * a local executor for this interceptor will be built otherwise
* @param exceptionHandler the {@link AsyncUncaughtExceptionHandler} to use to * @param exceptionHandler the {@link AsyncUncaughtExceptionHandler} to use to
* handle exceptions thrown by asynchronous method executions with {@code void} * handle exceptions thrown by asynchronous method executions with {@code void}
* return type * return type
@ -68,10 +71,10 @@ public class AnnotationAsyncExecutionInterceptor extends AsyncExecutionIntercept
* Return the qualifier or bean name of the executor to be used when executing the * Return the qualifier or bean name of the executor to be used when executing the
* given method, specified via {@link Async#value} at the method or declaring * given method, specified via {@link Async#value} at the method or declaring
* class level. If {@code @Async} is specified at both the method and class level, the * class level. If {@code @Async} is specified at both the method and class level, the
* method's {@code #value} takes precedence (even if empty string, indicating that * method's {@code value} takes precedence (even if empty string, indicating that
* the default executor should be used preferentially). * the default executor should be used preferentially).
* @param method the method to inspect for executor qualifier metadata * @param method the method to inspect for executor qualifier metadata
* @return the qualifier if specified, otherwise empty string indicating that the * @return the qualifier if specified, otherwise an empty string indicating that the
* {@linkplain #setExecutor(Executor) default executor} should be used * {@linkplain #setExecutor(Executor) default executor} should be used
* @see #determineAsyncExecutor(Method) * @see #determineAsyncExecutor(Method)
*/ */

View File

@ -42,8 +42,8 @@ import org.springframework.util.CollectionUtils;
* Helper bean for registering tasks with a {@link TaskScheduler}, typically using cron * Helper bean for registering tasks with a {@link TaskScheduler}, typically using cron
* expressions. * expressions.
* *
* <p>As of Spring 3.1, {@code ScheduledTaskRegistrar} has a more prominent user-facing * <p>{@code ScheduledTaskRegistrar} has a more prominent user-facing role when used in
* role when used in conjunction with the {@link * conjunction with the {@link
* org.springframework.scheduling.annotation.EnableAsync @EnableAsync} annotation and its * org.springframework.scheduling.annotation.EnableAsync @EnableAsync} annotation and its
* {@link org.springframework.scheduling.annotation.SchedulingConfigurer * {@link org.springframework.scheduling.annotation.SchedulingConfigurer
* SchedulingConfigurer} callback interface. * SchedulingConfigurer} callback interface.

View File

@ -622,7 +622,7 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
//--------------------------------------------------------------------- //---------------------------------------------------------------------
/** /**
* Specify a Spring 3.0 ConversionService to use for converting * Specify a {@link ConversionService} to use for converting
* property values, as an alternative to JavaBeans PropertyEditors. * property values, as an alternative to JavaBeans PropertyEditors.
*/ */
public void setConversionService(@Nullable ConversionService conversionService) { public void setConversionService(@Nullable ConversionService conversionService) {

View File

@ -43,12 +43,11 @@ package org.springframework.core.env;
* {@code Environment} in order to query profile state or resolve properties directly. * {@code Environment} in order to query profile state or resolve properties directly.
* *
* <p>In most cases, however, application-level beans should not need to interact with the * <p>In most cases, however, application-level beans should not need to interact with the
* {@code Environment} directly but instead may have to have {@code ${...}} property * {@code Environment} directly but instead may request to have {@code ${...}} property
* values replaced by a property placeholder configurer such as * values replaced by a property placeholder configurer such as
* {@link org.springframework.context.support.PropertySourcesPlaceholderConfigurer * {@link org.springframework.context.support.PropertySourcesPlaceholderConfigurer
* PropertySourcesPlaceholderConfigurer}, which itself is {@code EnvironmentAware} and * PropertySourcesPlaceholderConfigurer}, which itself is {@code EnvironmentAware} and
* as of Spring 3.1 is registered by default when using * registered by default when using {@code <context:property-placeholder/>}.
* {@code <context:property-placeholder/>}.
* *
* <p>Configuration of the {@code Environment} object must be done through the * <p>Configuration of the {@code Environment} object must be done through the
* {@code ConfigurableEnvironment} interface, returned from all * {@code ConfigurableEnvironment} interface, returned from all

View File

@ -25,11 +25,11 @@ import java.util.concurrent.Executor;
* <p>Implementations can use all sorts of different execution strategies, * <p>Implementations can use all sorts of different execution strategies,
* such as: synchronous, asynchronous, using a thread pool, and more. * such as: synchronous, asynchronous, using a thread pool, and more.
* *
* <p>Equivalent to JDK 1.5's {@link java.util.concurrent.Executor} * <p>Equivalent to Java's {@link java.util.concurrent.Executor} interface,
* interface; extending it now in Spring 3.0, so that clients may declare * so that clients may declare a dependency on an {@code Executor} and receive
* a dependency on an Executor and receive any TaskExecutor implementation. * any {@code TaskExecutor} implementation. This interface remains separate from
* This interface remains separate from the standard Executor interface * the standard {@code Executor} interface primarily for backwards compatibility
* mainly for backwards compatibility with JDK 1.4 in Spring 2.x. * with older APIs that depend on the {@code TaskExecutor} interface.
* *
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 2.0 * @since 2.0

View File

@ -22,13 +22,13 @@ import org.springframework.core.task.TaskExecutor;
import org.springframework.util.Assert; import org.springframework.util.Assert;
/** /**
* Adapter that exposes the {@link java.util.concurrent.Executor} interface * Adapter that exposes the {@link java.util.concurrent.Executor} interface for
* for any Spring {@link org.springframework.core.task.TaskExecutor}. * any Spring {@link org.springframework.core.task.TaskExecutor}.
* *
* <p>This is less useful as of Spring 3.0, since TaskExecutor itself * <p>This adapter is less useful since Spring 3.0, since TaskExecutor itself
* extends the Executor interface. The adapter is only relevant for * extends the {@code Executor} interface. The adapter is only relevant for
* <em>hiding</em> the TaskExecutor nature of a given object now, * <em>hiding</em> the {@code TaskExecutor} nature of a given object, solely
* solely exposing the standard Executor interface to a client. * exposing the standard {@code Executor} interface to a client.
* *
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 2.5 * @since 2.5

View File

@ -1265,17 +1265,17 @@ public abstract class ClassUtils {
/** /**
* Given a method, which may come from an interface, and a target class used * Given a method, which may come from an interface, and a target class used
* in the current reflective invocation, find the corresponding target method * in the current reflective invocation, find the corresponding target method
* if there is one. E.g. the method may be {@code IFoo.bar()} and the * if there is one &mdash; for example, the method may be {@code IFoo.bar()},
* target class may be {@code DefaultFoo}. In this case, the method may be * and the target class may be {@code DefaultFoo}. In this case, the method may be
* {@code DefaultFoo.bar()}. This enables attributes on that method to be found. * {@code DefaultFoo.bar()}. This enables attributes on that method to be found.
* <p><b>NOTE:</b> In contrast to {@link org.springframework.aop.support.AopUtils#getMostSpecificMethod}, * <p><b>NOTE:</b> In contrast to {@link org.springframework.aop.support.AopUtils#getMostSpecificMethod},
* this method does <i>not</i> resolve bridge methods automatically. * this method does <i>not</i> resolve bridge methods automatically.
* Call {@link org.springframework.core.BridgeMethodResolver#findBridgedMethod} * Call {@link org.springframework.core.BridgeMethodResolver#findBridgedMethod}
* if bridge method resolution is desirable (e.g. for obtaining metadata from * if bridge method resolution is desirable &mdash; for example, to obtain
* the original method definition). * metadata from the original method definition.
* <p><b>NOTE:</b> Since Spring 3.1.1, if Java security settings disallow reflective * <p><b>NOTE:</b> If Java security settings disallow reflective access &mdash;
* access (e.g. calls to {@code Class#getDeclaredMethods} etc, this implementation * for example, calls to {@code Class#getDeclaredMethods}, etc. &mdash; this
* will fall back to returning the originally provided method. * implementation will fall back to returning the originally provided method.
* @param method the method to be invoked, which may come from an interface * @param method the method to be invoked, which may come from an interface
* @param targetClass the target class for the current invocation * @param targetClass the target class for the current invocation
* (may be {@code null} or may not even implement the method) * (may be {@code null} or may not even implement the method)

View File

@ -43,17 +43,17 @@ import org.springframework.util.CollectionUtils;
* <p>Note: Since JDBC 4.0, it has been clarified that any methods using a String to identify * <p>Note: Since JDBC 4.0, it has been clarified that any methods using a String to identify
* the column should be using the column label. The column label is assigned using the ALIAS * the column should be using the column label. The column label is assigned using the ALIAS
* keyword in the SQL query string. When the query doesn't use an ALIAS, the default label is * keyword in the SQL query string. When the query doesn't use an ALIAS, the default label is
* the column name. Most JDBC ResultSet implementations follow this new pattern but there are * the column name. Most JDBC ResultSet implementations follow this pattern, but there are
* exceptions such as the {@code com.sun.rowset.CachedRowSetImpl} class which only uses * exceptions such as the {@code com.sun.rowset.CachedRowSetImpl} class which only uses
* the column name, ignoring any column labels. As of Spring 3.0.5, ResultSetWrappingSqlRowSet * the column name, ignoring any column labels. {@code ResultSetWrappingSqlRowSet}
* will translate column labels to the correct column index to provide better support for the * will translate column labels to the correct column index to provide better support for
* {@code com.sun.rowset.CachedRowSetImpl} which is the default implementation used by * {@code com.sun.rowset.CachedRowSetImpl} which is the default implementation used by
* {@link org.springframework.jdbc.core.JdbcTemplate} when working with RowSets. * {@link org.springframework.jdbc.core.JdbcTemplate} when working with RowSets.
* *
* <p>Note: This class implements the {@code java.io.Serializable} marker interface * <p>Note: This class implements the {@code java.io.Serializable} marker interface
* through the SqlRowSet interface, but is only actually serializable if the disconnected * through the SqlRowSet interface, but is only actually serializable if the disconnected
* ResultSet/RowSet contained in it is serializable. Most CachedRowSet implementations * ResultSet/RowSet contained in it is serializable. Most CachedRowSet implementations
* are actually serializable, so this should usually work out. * are actually serializable, so serialization should usually work.
* *
* @author Thomas Risberg * @author Thomas Risberg
* @author Juergen Hoeller * @author Juergen Hoeller
@ -78,7 +78,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
/** /**
* Create a new ResultSetWrappingSqlRowSet for the given ResultSet. * Create a new {@code ResultSetWrappingSqlRowSet} for the given {@link ResultSet}.
* @param resultSet a disconnected ResultSet to wrap * @param resultSet a disconnected ResultSet to wrap
* (usually a {@code javax.sql.rowset.CachedRowSet}) * (usually a {@code javax.sql.rowset.CachedRowSet})
* @throws InvalidResultSetAccessException if extracting * @throws InvalidResultSetAccessException if extracting

View File

@ -2,7 +2,7 @@
* This package contains mock implementations of the * This package contains mock implementations of the
* {@link org.springframework.core.env.Environment Environment} and * {@link org.springframework.core.env.Environment Environment} and
* {@link org.springframework.core.env.PropertySource PropertySource} * {@link org.springframework.core.env.PropertySource PropertySource}
* abstractions introduced in Spring 3.1. * abstractions.
* *
* <p>These <em>mocks</em> are useful for developing <em>out-of-container</em> * <p>These <em>mocks</em> are useful for developing <em>out-of-container</em>
* unit tests for code that depends on environment-specific properties. * unit tests for code that depends on environment-specific properties.

View File

@ -491,12 +491,12 @@ public class MockHttpServletResponse implements HttpServletResponse {
/** /**
* Return the primary value for the given header as a String, if any. * Return the primary value for the given header as a String, if any.
* Will return the first value in case of multiple values. * <p>Will return the first value in case of multiple values.
* <p>As of Servlet 3.0, this method is also defined in {@link HttpServletResponse}. * <p>Returns a stringified value for Servlet 3.0 compatibility. Consider
* As of Spring 3.1, it returns a stringified value for Servlet 3.0 compatibility. * using {@link #getHeaderValue(String)} for raw Object access.
* Consider using {@link #getHeaderValue(String)} for raw Object access.
* @param name the name of the header * @param name the name of the header
* @return the associated header value, or {@code null} if none * @return the associated header value, or {@code null} if none
* @see HttpServletResponse#getHeader(String)
*/ */
@Override @Override
@Nullable @Nullable
@ -507,11 +507,11 @@ public class MockHttpServletResponse implements HttpServletResponse {
/** /**
* Return all values for the given header as a List of Strings. * Return all values for the given header as a List of Strings.
* <p>As of Servlet 3.0, this method is also defined in {@link HttpServletResponse}. * <p>Returns a List of stringified values for Servlet 3.0 compatibility.
* As of Spring 3.1, it returns a List of stringified values for Servlet 3.0 compatibility.
* Consider using {@link #getHeaderValues(String)} for raw Object access. * Consider using {@link #getHeaderValues(String)} for raw Object access.
* @param name the name of the header * @param name the name of the header
* @return the associated header values, or an empty List if none * @return the associated header values, or an empty List if none
* @see HttpServletResponse#getHeaders(String)
*/ */
@Override @Override
public List<String> getHeaders(String name) { public List<String> getHeaders(String name) {

View File

@ -34,17 +34,16 @@ import org.springframework.core.annotation.AliasFor;
* *
* <h3>Supported Resource Types</h3> * <h3>Supported Resource Types</h3>
* *
* <p>Prior to Spring 3.1, only path-based resource locations (typically XML configuration * <p>{@linkplain #loader Context loaders} may choose to support <em>either</em>
* files) were supported. As of Spring 3.1, {@linkplain #loader context loaders} may * path-based resource locations (typically XML configuration files) <em>or</em>
* choose to support <em>either</em> path-based <em>or</em> class-based resources. As of * class-based resources. Alternatively, context loaders may choose to support
* Spring 4.0.4, {@linkplain #loader context loaders} may choose to support path-based * path-based <em>and</em> class-based resources simultaneously. Consequently
* <em>and</em> class-based resources simultaneously. Consequently
* {@code @ContextConfiguration} can be used to declare either path-based resource * {@code @ContextConfiguration} can be used to declare either path-based resource
* locations (via the {@link #locations} or {@link #value} attribute) <em>or</em> * locations (via the {@link #locations} or {@link #value} attribute) <em>or</em>
* component classes (via the {@link #classes} attribute). Note, however, that most * component classes (via the {@link #classes} attribute). Note, however, that most
* implementations of {@link SmartContextLoader} only support a single resource type. As * implementations of {@link SmartContextLoader} only support a single resource type.
* of Spring 4.1, path-based resource locations may be either XML configuration files or * Path-based resource locations may be either XML configuration files or Groovy
* Groovy scripts (if Groovy is on the classpath). Of course, third-party frameworks may * scripts (if Groovy is on the classpath). Of course, third-party frameworks may
* choose to support additional types of path-based resources. * choose to support additional types of path-based resources.
* *
* <h3>Component Classes</h3> * <h3>Component Classes</h3>

View File

@ -49,9 +49,9 @@ import org.springframework.util.ResourceUtils;
* <em>Template Method</em> based approach for {@link #processLocations processing} * <em>Template Method</em> based approach for {@link #processLocations processing}
* resource locations. * resource locations.
* *
* <p>As of Spring 3.1, {@code AbstractContextLoader} also provides a basis * <p>{@code AbstractContextLoader} also provides a basis for all concrete implementations
* for all concrete implementations of the {@link SmartContextLoader} SPI. For * of the {@link SmartContextLoader} SPI. For backwards compatibility with the
* backwards compatibility with the {@code ContextLoader} SPI, * {@code ContextLoader} SPI,
* {@link #processContextConfiguration(ContextConfigurationAttributes)} delegates * {@link #processContextConfiguration(ContextConfigurationAttributes)} delegates
* to {@link #processLocations(Class, String...)}. * to {@link #processLocations(Class, String...)}.
* *
@ -233,11 +233,11 @@ public abstract class AbstractContextLoader implements SmartContextLoader {
* is the value of the first configured * is the value of the first configured
* {@linkplain #getResourceSuffixes() resource suffix} for which the * {@linkplain #getResourceSuffixes() resource suffix} for which the
* generated location actually exists in the classpath. * generated location actually exists in the classpath.
* <p>As of Spring 3.1, the implementation of this method adheres to the * <p>The implementation of this method adheres to the contract defined in the
* contract defined in the {@link SmartContextLoader} SPI. Specifically, * {@link SmartContextLoader} SPI. Specifically, this method will
* this method will <em>preemptively</em> verify that the generated default * <em>preemptively</em> verify that the generated default location actually
* location actually exists. If it does not exist, this method will log a * exists. If it does not exist, this method will log a warning and return an
* warning and return an empty array. * empty array.
* <p>Subclasses can override this method to implement a different * <p>Subclasses can override this method to implement a different
* <em>default location generation</em> strategy. * <em>default location generation</em> strategy.
* @param clazz the class for which the default locations are to be generated * @param clazz the class for which the default locations are to be generated
@ -294,13 +294,13 @@ public abstract class AbstractContextLoader implements SmartContextLoader {
* Determine whether <em>default</em> resource locations should be * Determine whether <em>default</em> resource locations should be
* generated if the {@code locations} provided to * generated if the {@code locations} provided to
* {@link #processLocations(Class, String...)} are {@code null} or empty. * {@link #processLocations(Class, String...)} are {@code null} or empty.
* <p>As of Spring 3.1, the semantics of this method have been overloaded * <p>The semantics of this method have been overloaded to include detection
* to include detection of either default resource locations or default * of either default resource locations or default configuration classes.
* configuration classes. Consequently, this method can also be used to * Consequently, this method can also be used to determine whether
* determine whether <em>default</em> configuration classes should be * <em>default</em> configuration classes should be detected if the
* detected if the {@code classes} present in the * {@code classes} present in the {@linkplain ContextConfigurationAttributes
* {@link ContextConfigurationAttributes configuration attributes} supplied * configuration attributes} supplied to
* to {@link #processContextConfiguration(ContextConfigurationAttributes)} * {@link #processContextConfiguration(ContextConfigurationAttributes)}
* are {@code null} or empty. * are {@code null} or empty.
* <p>Can be overridden by subclasses to change the default behavior. * <p>Can be overridden by subclasses to change the default behavior.
* @return always {@code true} by default * @return always {@code true} by default

View File

@ -60,8 +60,8 @@ import org.springframework.util.Assert;
* (e.g., XML configuration files and Groovy scripts) or annotated classes, * (e.g., XML configuration files and Groovy scripts) or annotated classes,
* but not both simultaneously. * but not both simultaneously.
* *
* <p>As of Spring Framework 3.2, a test class may optionally declare neither path-based * <p>A test class may optionally declare neither path-based resource locations
* resource locations nor annotated classes and instead declare only {@linkplain * nor annotated classes and instead declare only {@linkplain
* ContextConfiguration#initializers application context initializers}. In such * ContextConfiguration#initializers application context initializers}. In such
* cases, an attempt will still be made to detect defaults, but their absence will * cases, an attempt will still be made to detect defaults, but their absence will
* not result in an exception. * not result in an exception.

View File

@ -23,12 +23,10 @@ import org.springframework.util.ResourceUtils;
* Extension of {@link SpringJUnit4ClassRunnerAppCtxTests}, which verifies that * Extension of {@link SpringJUnit4ClassRunnerAppCtxTests}, which verifies that
* we can specify multiple resource locations for our application context, each * we can specify multiple resource locations for our application context, each
* configured differently. * configured differently.
* <p> *
* As of Spring 3.0, * <p>{@code MultipleResourcesSpringJUnit4ClassRunnerAppCtxTests} is also used
* {@code MultipleResourcesSpringJUnit4ClassRunnerAppCtxTests} is also used * to verify support for the {@code value} attribute alias for
* to verify support for the new {@code value} attribute alias for
* {@code @ContextConfiguration}'s {@code locations} attribute. * {@code @ContextConfiguration}'s {@code locations} attribute.
* </p>
* *
* @author Sam Brannen * @author Sam Brannen
* @since 2.5 * @since 2.5

View File

@ -70,10 +70,10 @@ import org.springframework.util.StringUtils;
* load or obtain and hook up a shared parent context to the root application context. * load or obtain and hook up a shared parent context to the root application context.
* See the {@link #loadParentContext(ServletContext)} method for more information. * See the {@link #loadParentContext(ServletContext)} method for more information.
* *
* <p>As of Spring 3.1, {@code ContextLoader} supports injecting the root web * <p>{@code ContextLoader} supports injecting the root web application context
* application context via the {@link #ContextLoader(WebApplicationContext)} * via the {@link #ContextLoader(WebApplicationContext)} constructor, allowing for
* constructor, allowing for programmatic configuration in Servlet initializers. * programmatic configuration in Servlet initializers. See
* See {@link org.springframework.web.WebApplicationInitializer} for usage examples. * {@link org.springframework.web.WebApplicationInitializer} for usage examples.
* *
* @author Juergen Hoeller * @author Juergen Hoeller
* @author Colin Sampaleanu * @author Colin Sampaleanu

View File

@ -23,8 +23,8 @@ import jakarta.servlet.ServletContextListener;
* Bootstrap listener to start up and shut down Spring's root {@link WebApplicationContext}. * Bootstrap listener to start up and shut down Spring's root {@link WebApplicationContext}.
* Simply delegates to {@link ContextLoader} as well as to {@link ContextCleanupListener}. * Simply delegates to {@link ContextLoader} as well as to {@link ContextCleanupListener}.
* *
* <p>As of Spring 3.1, {@code ContextLoaderListener} supports injecting the root web * <p>{@code ContextLoaderListener} supports injecting the root web application
* application context via the {@link #ContextLoaderListener(WebApplicationContext)} * context via the {@link #ContextLoaderListener(WebApplicationContext)}
* constructor, allowing for programmatic configuration in Servlet initializers. * constructor, allowing for programmatic configuration in Servlet initializers.
* See {@link org.springframework.web.WebApplicationInitializer} for usage examples. * See {@link org.springframework.web.WebApplicationInitializer} for usage examples.
* *

View File

@ -63,8 +63,8 @@ import org.springframework.web.context.ContextLoader;
* ContextLoader and/or "contextClass" init-param for FrameworkServlet must be set to * ContextLoader and/or "contextClass" init-param for FrameworkServlet must be set to
* the fully-qualified name of this class. * the fully-qualified name of this class.
* *
* <p>As of Spring 3.1, this class may also be directly instantiated and injected into * <p>This class may also be directly instantiated and injected into Spring's
* Spring's {@code DispatcherServlet} or {@code ContextLoaderListener} when using the * {@code DispatcherServlet} or {@code ContextLoaderListener} when using the
* {@link org.springframework.web.WebApplicationInitializer WebApplicationInitializer} * {@link org.springframework.web.WebApplicationInitializer WebApplicationInitializer}
* code-based alternative to {@code web.xml}. See its Javadoc for details and usage examples. * code-based alternative to {@code web.xml}. See its Javadoc for details and usage examples.
* *

View File

@ -33,9 +33,9 @@ import org.springframework.web.context.ServletContextAware;
* In a purely Spring-based web application, no such linking in of * In a purely Spring-based web application, no such linking in of
* ServletContext attributes will be necessary. * ServletContext attributes will be necessary.
* *
* <p><b>NOTE:</b> As of Spring 3.0, you may also use the "contextAttributes" default * <p><b>NOTE:</b> You may also use the "contextAttributes" default bean, which is
* bean which is of type Map, and dereference it using an "#{contextAttributes.myKey}" * of type Map, and dereference it using a "#{contextAttributes.myKey}" expression
* expression to access a specific attribute by name. * to access a specific attribute by name.
* *
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 1.1.4 * @since 1.1.4

View File

@ -28,8 +28,8 @@ import org.springframework.web.context.ServletContextAware;
* Exposes that ServletContext init parameter when used as bean reference, * Exposes that ServletContext init parameter when used as bean reference,
* effectively making it available as named Spring bean instance. * effectively making it available as named Spring bean instance.
* *
* <p><b>NOTE:</b> As of Spring 3.0, you may also use the "contextParameters" default * <p><b>NOTE:</b> You may also use the "contextParameters" default bean, which
* bean which is of type Map, and dereference it using an "#{contextParameters.myKey}" * is of type Map, and dereference it using a "#{contextParameters.myKey}"
* expression to access a specific parameter by name. * expression to access a specific parameter by name.
* *
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -42,7 +42,7 @@ import org.springframework.web.context.support.WebApplicationContextUtils;
* be delegated to that bean in the Spring context, which is required to implement * be delegated to that bean in the Spring context, which is required to implement
* the standard Servlet Filter interface. * the standard Servlet Filter interface.
* *
* <p>This approach is particularly useful for Filter implementation with complex * <p>This approach is particularly useful for Filter implementations with complex
* setup needs, allowing to apply the full Spring bean definition machinery to * setup needs, allowing to apply the full Spring bean definition machinery to
* Filter instances. Alternatively, consider standard Filter setup in combination * Filter instances. Alternatively, consider standard Filter setup in combination
* with looking up service beans from the Spring root application context. * with looking up service beans from the Spring root application context.
@ -51,12 +51,13 @@ import org.springframework.web.context.support.WebApplicationContextUtils;
* will by default <i>not</i> be delegated to the target bean, relying on the * will by default <i>not</i> be delegated to the target bean, relying on the
* Spring application context to manage the lifecycle of that bean. Specifying * Spring application context to manage the lifecycle of that bean. Specifying
* the "targetFilterLifecycle" filter init-param as "true" will enforce invocation * the "targetFilterLifecycle" filter init-param as "true" will enforce invocation
* of the {@code Filter.init} and {@code Filter.destroy} lifecycle methods * of the {@link Filter#init(jakarta.servlet.FilterConfig)} and
* on the target bean, letting the servlet container manage the filter lifecycle. * {@link Filter#destroy()} lifecycle methods on the target bean, letting the
* Servlet container manage the filter lifecycle.
* *
* <p>As of Spring 3.1, {@code DelegatingFilterProxy} has been updated to optionally * <p>{@code DelegatingFilterProxy} can optionally accept constructor parameters
* accept constructor parameters when using a Servlet container's instance-based filter * when using a Servlet container's instance-based filter registration methods,
* registration methods, usually in conjunction with Spring's * usually in conjunction with Spring's
* {@link org.springframework.web.WebApplicationInitializer} SPI. These constructors allow * {@link org.springframework.web.WebApplicationInitializer} SPI. These constructors allow
* for providing the delegate Filter bean directly, or providing the application context * 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 * and bean name to fetch, avoiding the need to look up the application context from the

View File

@ -22,23 +22,11 @@ import org.springframework.core.NestedExceptionUtils;
import org.springframework.lang.Nullable; import org.springframework.lang.Nullable;
/** /**
* Subclass of {@link ServletException} that properly handles a root cause in terms * Legacy subclass of {@link ServletException} that handles a root cause in terms
* of message and stacktrace, just like NestedChecked/RuntimeException does. * of message and stacktrace.
*
* <p>Note that the plain ServletException doesn't expose its root cause at all,
* neither in the exception message nor in printed stack traces! While this might
* be fixed in later Servlet API variants (which even differ per vendor for the
* same API version), it is not reliably available on Servlet 2.4 (the minimum
* version required by Spring 3.x), which is why we need to do it ourselves.
*
* <p>The similarity between this class and the NestedChecked/RuntimeException
* class is unavoidable, as this class needs to derive from ServletException.
* *
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 1.2.5 * @since 1.2.5
* @see #getMessage
* @see org.springframework.core.NestedCheckedException
* @see org.springframework.core.NestedRuntimeException
* @deprecated as of 6.0, in favor of standard {@link ServletException} nesting * @deprecated as of 6.0, in favor of standard {@link ServletException} nesting
*/ */
@Deprecated(since = "6.0") @Deprecated(since = "6.0")

View File

@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
/** /**
* Tests the interaction between a WebApplicationContext and ContextLoaderListener with * Tests the interaction between a WebApplicationContext and ContextLoaderListener with
* regard to config location precedence, overriding and defaulting in programmatic * regard to config location precedence, overriding and defaulting in programmatic
* configuration use cases, e.g. with Spring 3.1's WebApplicationInitializer. * configuration use cases, e.g. with WebApplicationInitializer.
* *
* @author Chris Beams * @author Chris Beams
* @since 3.1 * @since 3.1

View File

@ -491,12 +491,12 @@ public class MockHttpServletResponse implements HttpServletResponse {
/** /**
* Return the primary value for the given header as a String, if any. * Return the primary value for the given header as a String, if any.
* Will return the first value in case of multiple values. * <p>Will return the first value in case of multiple values.
* <p>As of Servlet 3.0, this method is also defined in {@link HttpServletResponse}. * <p>Returns a stringified value for Servlet 3.0 compatibility. Consider
* As of Spring 3.1, it returns a stringified value for Servlet 3.0 compatibility. * using {@link #getHeaderValue(String)} for raw Object access.
* Consider using {@link #getHeaderValue(String)} for raw Object access.
* @param name the name of the header * @param name the name of the header
* @return the associated header value, or {@code null} if none * @return the associated header value, or {@code null} if none
* @see HttpServletResponse#getHeader(String)
*/ */
@Override @Override
@Nullable @Nullable
@ -507,11 +507,11 @@ public class MockHttpServletResponse implements HttpServletResponse {
/** /**
* Return all values for the given header as a List of Strings. * Return all values for the given header as a List of Strings.
* <p>As of Servlet 3.0, this method is also defined in {@link HttpServletResponse}. * <p>Returns a List of stringified values for Servlet 3.0 compatibility.
* As of Spring 3.1, it returns a List of stringified values for Servlet 3.0 compatibility.
* Consider using {@link #getHeaderValues(String)} for raw Object access. * Consider using {@link #getHeaderValues(String)} for raw Object access.
* @param name the name of the header * @param name the name of the header
* @return the associated header values, or an empty List if none * @return the associated header values, or an empty List if none
* @see HttpServletResponse#getHeaders(String)
*/ */
@Override @Override
public List<String> getHeaders(String name) { public List<String> getHeaders(String name) {

View File

@ -145,9 +145,9 @@ import org.springframework.web.util.WebUtils;
* with mappings, handlers, etc. Only the root application context as loaded by * with mappings, handlers, etc. Only the root application context as loaded by
* {@link org.springframework.web.context.ContextLoaderListener}, if any, will be shared. * {@link org.springframework.web.context.ContextLoaderListener}, if any, will be shared.
* *
* <p>As of Spring 3.1, {@code DispatcherServlet} may now be injected with a web * <p>{@code DispatcherServlet} may be injected with a web application context,
* application context, rather than creating its own internally. This is useful in Servlet * rather than creating its own internally. This is useful in Servlet 3.0+
* 3.0+ environments, which support programmatic registration of servlet instances. * environments, which support programmatic registration of servlet instances.
* See the {@link #DispatcherServlet(WebApplicationContext)} javadoc for details. * See the {@link #DispatcherServlet(WebApplicationContext)} javadoc for details.
* *
* @author Rod Johnson * @author Rod Johnson

View File

@ -123,9 +123,9 @@ import org.springframework.web.util.WebUtils;
* with XmlWebApplicationContext). The namespace can also be set explicitly via * with XmlWebApplicationContext). The namespace can also be set explicitly via
* the "namespace" servlet init-param. * the "namespace" servlet init-param.
* *
* <p>As of Spring 3.1, {@code FrameworkServlet} may now be injected with a web * <p>{@code FrameworkServlet} may be injected with a web application context,
* application context, rather than creating its own internally. This is useful in Servlet * rather than creating its own internally. This is useful in Servlet 3.0+
* 3.0+ environments, which support programmatic registration of servlet instances. See * environments, which support programmatic registration of servlet instances. See
* {@link #FrameworkServlet(WebApplicationContext)} Javadoc for details. * {@link #FrameworkServlet(WebApplicationContext)} Javadoc for details.
* *
* @author Rod Johnson * @author Rod Johnson