Commit Graph

1341 Commits

Author SHA1 Message Date
Stephane Nicoll
d74d657372 Polish 2015-08-26 17:52:19 +02:00
Stephane Nicoll
63d157bb7c Favor JSR-107 provider if present
Previously, native cache libraries were favored over a standard JSR-107
implementation. If a user has a working setup using JCache with one
provider and switch to another provider, his setup may be broken if we
happen to provide a native support for the new provider.

We now consistently favor JSR-107 if it is present. Native support can
still be enabled via the `spring.cache.type` property.

Closes gh-3822
2015-08-25 15:07:24 +02:00
Dave Syer
ff8a4d0f9d Merge branch '1.0.x'
Conflicts: MessageSourceAutoConfiguration.java
2015-08-21 17:13:19 +01:00
Dave Syer
68b55adac0 Add search=CURRENT to MessageSourceAutoConfiguration
Fixes gh-3803
2015-08-21 15:44:01 +01:00
Dave Syer
2583f8050a Enable Tomcat RemoteIpValve by default
Fixes gh-3782
2015-08-21 09:26:05 +01:00
Stephane Nicoll
8543a3ca91 Improve use of SSL config in RabbitConnectionFactory
Previously we had to create a fake Properties object as the factory did
not provide individual setters for the SSL configuration. This has been
added as part of Spring AMQP 1.5.0.RC1 so we're using those instead.

Closes gh-3754
2015-08-21 09:49:59 +02:00
Stephane Nicoll
48f16c4386 Avoid Tomcat specific dependency in ServerProperties
Closes gh-3781
2015-08-20 17:17:43 +02:00
Stephane Nicoll
4235df180e Polish
See gh-3792
2015-08-20 14:54:40 +02:00
Stephane Nicoll
1466169dc0 Register ResourceUrlEncodingFilter only if necessary
Previously, `ResourceUrlEncodingFilter` was registered even if the
resource chain handling was disabled (which is the default).

We now take care of registering it only if the resource chain handling is
enabled.

Closes gh-3353
2015-08-20 10:33:04 +02:00
Martin Lippert
678f36cfef configure JRE that is different from compiler target level 2015-08-19 17:00:38 +01:00
Stephane Nicoll
7c0c953f81 Add value alias for SpringApplicationConfiguration
Given that Spring Boot uses java config accross the board, a new `value`
attribute is now aliased to the existing `classes` attribute such that
one could write the following:

@SpringApplicationConfiguration(MyConfig.class)
public class MyTest {}

Closes gh-3635
2015-08-19 17:09:34 +02:00
Stephane Nicoll
58d0776abe Polish 2015-08-14 14:08:27 +02:00
Stephane Nicoll
d1a4d6958a Document spring.datasource.name
The `spring.datasource.name` property was hidden behind the 'name'
attribute of the Tomcat connection pool (since we are mapping all
datasource implementations on the `spring.datasource` namespace.

This commit replace the injected value by hand with the use of the
regular `DataSourceProperties`. That way, we generate proper meta-data
for it as well.

Closes gh-3755
2015-08-14 14:07:38 +02:00
Stephane Nicoll
2d62e1fc89 Add a property to configure the connection pool
A new `spring.datasource.type` property can now be used to configure the
connection pool implementation to use (rather than only relying on Boot's
preferences).

Closes gh-3705
2015-08-14 13:30:14 +02:00
Stephane Nicoll
4e0f99ed8b Polish
Closes gh-3750
2015-08-14 09:24:24 +02:00
Eddú Meléndez
74e1a1c940 Add fallbackToSystemLocale configuration key
Allow to configure the `fallbackToSystemLocale` attribute of
`MessageSource` via configuration.

Closes gh-3749
2015-08-14 09:09:40 +02:00
Andy Wilkinson
c15a670c6d Workaround bizarre compiler problem 2015-08-13 15:46:38 +01:00
Andy Wilkinson
51dd806a98 Detect ConfigurableWebBindingInitializer bean and register with MVC
Previously, to use a custom ConfigurableWebBindingInitializer, it was
necessary to extend WebMvcConfigurationSupport and override
getConfigurableWebBindingInitializer. This had the unwanted
side-effect of switching off the auto-configuration of Spring MVC.

This commit updates the auto-configuration to look for a
ConfigurableWebBindingInitializer bean and register it with Spring
MVC.

Closes gh-2526
2015-08-13 15:20:59 +01:00
izeye
eab7eff047 Polish documentation
Closes gh-3738
2015-08-13 12:58:53 +01:00
Dave Syer
84a3e3827b Ensure tomcat on the classpath does not imply web application 2015-08-11 09:34:20 +01:00
Andy Wilkinson
2ae8a021f9 Merge branch '1.2.x' 2015-08-10 16:59:04 +01:00
Andy Wilkinson
a2f4c1cc4a Add support for configuring allowSessionOverride via the environment
This commit adds support for using the environment to configure the
Freemarker and Velocity view resolvers to allow session overrides.

Closes gh-3410
2015-08-10 16:58:17 +01:00
Andy Wilkinson
1e4c972c3d Fix customJodaDateTimeFormat to specify time zone when creating Date
See gh-3569
2015-08-10 12:36:54 +01:00
Dave Syer
2985b0e9d8 Clarify init params in Jersey autoconfig (only servlet and filter)
See gh-3557
2015-08-10 10:50:49 +01:00
Andy Wilkinson
9fcc860908 Polish contribution
Closes gh-3643
2015-08-06 12:06:39 +01:00
Joao Pedro Evangelista
7568af1710 Add auto-configuration of HttpPutContentFormFilter
Closes gh-3652
2015-08-06 12:06:28 +01:00
Phillip Webb
9a53707014 Add @ImportAutoConfiguration annotation for tests
Add a new `@ImportAutoConfiguration` annotation that can be used by
tests that wish to selectively import certain auto-configuration
classes. Also add `@AutoConfigurationPackage` so that package
registration is decoupled from `@EnableAutoConfiguration`.

An added benefit of the change is @EnableAutoConfigurationImportSelector
can now be subclassed to provide custom annotation support if needed.

Fixes gh-3660
See gh-2772
2015-08-05 14:58:19 -07:00
Phillip Webb
8d92236eea Polish 2015-08-05 12:09:23 -07:00
Phillip Webb
3ff878a94b Remove include from @EnableAutoConfiguration
Revert commit 1d31d23e29 to
remove `include` from `@EnableAutoConfiguration`. We'll
add a dedicated annotation instead to fix this.

See gh-3660
2015-08-05 10:03:43 -07:00
Eric Bottard
2b15ea65e2 Polish Javadoc
Closes gh-3667
2015-08-05 14:37:55 +02:00
Stephane Nicoll
6c7a5c5077 Harmonize Undertow's access log properties
Harmonize the configuration properties for Undertow to match the changes
made for gh-2491.

Move `spring.undertow.accessLog*` to `spring.undertow.accesslog.*`
2015-08-05 14:34:48 +02:00
Stephane Nicoll
62406546e2 Improve customization of Tomcat's access log
Add `directory`, `prefix` and `suffix` properties to further customize
how access logs are configured on Tomcat. Relocate all properties to the
`server.tomcat.accesslog` namespace.

`server.tomcat.accessLogPattern` and `server.tomcat.accessLogEnabled` are
deprecated and replaced by `server.tomcat.accesslog.pattern` and
`server.tomcat.accesslog.enabled` respectively.

Closes gh-2491
2015-08-05 14:34:48 +02:00
Andy Wilkinson
2a5a32b603 Add auto-configuration for H2’s web console
Three conditions must be met for the console to be enabled:

 - H2 is on the classpath
 - The application is a web application
 - spring.h2.console.enabled is set to true

If spring-boot-devtools is on the classpath, spring.h2.console.enabled
will be set to true automatically. Without the dev tools, the enabled
property will have to be set to true in application.properties.

By default, the console is available at /h2-console. This can be
configured via the spring.h2.console.path property. The value of this
property must begin with a '/'.

When Spring Security is on the classpath the console will be secured
based on the user's security.* configuration. When the console is
secured, CSRF protection is disabled and frame options is set to
SAMEORIGIN for its path. Both settings are required in order for the
console to function.

Closes gh-766
2015-08-05 10:54:03 +01:00
Phillip Webb
1d31d23e29 Add include support to @EnableAutoConfiguration
Update the `@EnableAutoConfiguration` annotation to include an `include`
attribute which can be used to specify specific auto-configuration
classes.

Primarily added to so that tests can selectively auto-configure without
needing to worry about class import order.

Fixes gh-3660
2015-08-04 16:43:05 -07:00
Phillip Webb
4279ffeddf Polish formatting 2015-08-04 15:07:42 -07:00
Stephane Nicoll
7669e888cb Polish
Closes gh-3649
2015-08-04 15:11:11 +02:00
jhernan
d8bf3a72da Customize mail sender protocol
See gh-3649
2015-08-04 15:08:49 +02:00
Stephane Nicoll
d18180e2e4 Add missing package-info 2015-08-04 14:00:38 +02:00
Stephane Nicoll
bfe930a873 Auto-configure @EnableConfigurationProperties
Add an auto-configuration that avoid a Spring Boot user to add
`@EnableConfigurationProperties` to its configuration to benefit from
that feature.

As our own auto-configurations are tested independently, such annotation
is still present to avoid a useless reference to this new
auto-configuration.

Closes gh-2457
2015-08-04 13:59:57 +02:00
Andy Wilkinson
0e8812f0e9 Merge branch '1.2.x' 2015-08-04 11:43:45 +01:00
Andy Wilkinson
905346d0cd Consider @Bean methods with args to determine type created by factory
Previously, BeanTypeRegistry would only look for a @Bean method
with no arguments when trying to determine the type that will be
created by a factory bean. This meant that the type produced by a
factory bean declared via a @Bean that has one or more arguments would
be unknown and any on missing bean conditions look for a bean of the
type produced by the factory bean would match in error.

This commit updates BeanTypeRegistry to, where possible, use the
factory method metadata for the bean definition when determining the
type that will be created. This allows it to determine the type for
factory bean created by @Bean methods that take arguments and also
avoids the use reflection to find the factory method. Where factory
method metadata is not available, the existing reflection-based
approach is used as a fallback.

Closes gh-3657
2015-08-04 11:34:53 +01:00
Stephane Nicoll
eb5d92f3f0 Exclude auto-configurations via property
Add `spring.autoconfigure.exclude` to control the list of
auto-configuration classes to exclude via configuration. Merge the
exclusions defined on the `@EnableAutoConfiguration` or
`@SpringBooApplication` if any.

Closes gh-2435
2015-08-04 10:50:49 +02:00
Rob Winch
f543e3259e Add Test that HiddenHttpMethodFilter before FilterChainProxy
Fixes gh-3447
2015-08-03 14:22:23 -05:00
Phillip Webb
891dd5a0f6 Polish 2015-08-03 11:03:48 -07:00
Stephane Nicoll
15442b9667 Avoid wrong meta-data
Make `getFaviconLocations` package private so that it's not (wrongly)
exposed in the meta-data.

Closes gh-3647
2015-08-03 10:46:33 +02:00
Stephane Nicoll
3cae8e4d20 Remove outdated key 2015-08-03 10:11:10 +02:00
Stephane Nicoll
d9648a36fe Add more specific test
Add an error controller test that translates a ResponseStatus annotated
exception that does not contain a reason attribute.

See gh-3623
2015-07-30 17:08:03 +02:00
Stephane Nicoll
96fc107ca1 Customize Thymeleaf default template resolver order
Currently, the default TemplateResolver had no specific order. Thymeleaf
handles that with a "always first" strategy (that can be confusing if
several TemplateResolver have a "null" order.

While it is a fine default (and changing it could lead to weird side
effects), it has to be changed as soon as another TemplateResolver bean
is defined in the project.

The `spring.thymeleaf.template-resolver-order` property has been added to
control  the order of the default TemplateResolver.

Closes gh-3575
2015-07-28 14:28:31 +02:00
izeye
ee6fc8d917 Fix typos
Closes gh-3608
2015-07-28 08:54:47 +02:00
Stephane Nicoll
32128a6ac2 Polish 2015-07-27 16:02:03 +02:00