Update RelaxedDataBinder so that multiple overlapping nested property
names can be bound to a Map.
Prior to this commit, properties of the following form could not be
bound to Maps:
foo: baz
foo.bar: spam
This was due to BeanWrapperImpl throwing an InvalidPropertyException
when binding `map[foo][bar]` because `foo` is already bound to `baz`.
The updated code now detects such cases and instead uses the binding
property `map[foo.bar]`.
Fixes gh-2610
Prior to this commit, every EndpointMBean used its own ObjectMapper.
Each of these ObjectMappers was created using new ObjectMapper() with
no opportunity for configuration.
This commit uses the ObjectMapper from the application context and
shares it among all EndpointMBeans. This gives the user control over
the ObjectMapper’s configuration using spring.jackson.* properties,
their own Jackson2ObjectMapperBuilder bean, etc. In the absence of an
ObjectMapper in the application context a single ObjectMapper is
instantiated and is used by all EndpointMBeans instead.
To allow the ObjectMapper to be shared, a number of constructors have
been overloaded to also take the ObjectMapper as a parameter. In these
cases the old constructor has been preserved for backwards compatibility
but has been deprecated.
Closes gh-2393
Prior to this commit, the auto-configuration report (both in its logged
form and the actuator endpoint) listed the positive and negative matches
but did not list the classes, if any, that the user had excluded.
This commit updates the logged report and the actuator endpoint to
expose a list of the excluded class names configured via the exclude
attribute on @EnableAutoConfiguration.
Closes gh-2085
Previously, the only starter that provided validation was
spring-boot-starter-web which included Hibernate Validator and
Tomcat's EL implementation. This left users writing non-web
applications to figure out the dependencies for themselves. They would
sometimes run into difficulties as Hibernate Validator's need for an
EL implementation would trip them up.
This commit adds a new starter, spring-boot-starter-validation,
which provides both Hibernate Validator and Tomcat's EL
implementation. spring-boot-starter-web has been updated to depend on
this starter rather than depending on Hibernate Validator directly.
Closes gh-2678
The documentation claims that JSPs don't work with embedded Jetty
making the dependency on jetty-jsp pointless. Furthermore,
spring-boot-starter-tomcat doesn't include JSP support and Undertow
doesn't support JSPs at all so removing jetty-jsp makes the embedded
container starters more consistent. It also removes 3.2MB from a
Jetty-based fat jar (spring-boot-sample-jetty drops from 12MB to
8.8MB).
Closes gh-2680
Previously, disk health information only included the amount of free
space and the configured threshold. This commit adds the disk’s total
space.
See gh-2705
Tomcat uses the strings “on” and “off” to enable and disable
compression. YAML interprets on as true and off as false, leaving
ServerProperties.Tomcat.compression configured with “true” and “false”
respectively. One solution is to use “on” rather than on and “off”
rather than off in the YAML file but users may not realise that they
need to do so.
This commit updates the connector customiser that configures compression
to map “true” to “on” and “false” to “off”.
Closes gh-2737
Include auto-configuration support for EhCache with auto-detection of
the default `ehcache.xml` at the root of the classpath. EhCache
configuration can also be set via `spring.cache.config`.
See gh-2633
Add support for cache manager auto-configuration that is triggered when
the `EnableCaching` annotation is added to a Spring Boot application.
A new "spring.cache" set of configuration keys is also provided. The
"spring.cache.mode" allows the user to specify the cache provider that
should be auto-configured. If no explicit configuration is provided,
the environment is checked for the best suited cache implementation,
that is:
- Generic if at least one `Cache` bean is defined in the context.
- Hazelcast if either a default configuration file is present or the
`spring.cache.config` property is set.
- JCache if one JSR-107 provider is present
- Redis if a `RedisTemplate` is defined in the context
- Guava
- Simple as a fallback option, using concurrent maps
- NoOp (that is, no cache) if the mode is set to "none"
If the provider supports it, it is possible to specify the caches
to create on startup via `spring.cache.cache-names`. If the provider
relies on a configuration file and a custom one needs to be used
`spring.cache.config` can be set to such custom resource.
If more than one JSR-107 provider is present, it is possible to force
the provider to use by setting the mode to `jcache` and specifying the
fully qualified class name of the CachingProvider to use via
`spring.cache.jcache.provider`.
See gh-2633
SmartApplicationListener has been superseded by GenericEventListener as
of Spring Framework 4.2. It will be eventually deprecated and removed.
Migrate our event listeners to use the new contract.
Closes gh-2576
When configured with a context path of "", Undertow 1.1.3 changes the
context path to be "/". The change [1] was made to fix UNDERTOW-350
[2].
[1] 3db7707b8b
[2] https://issues.jboss.org/browse/UNDERTOW-350
See gh-2732