Commit Graph

1574 Commits

Author SHA1 Message Date
Phillip Webb 162b9e84a3 Polish 2016-07-26 22:47:51 -07:00
Brian Clozel a282710fc9 Add Locale to Charset Mapping for Servlet containers
This commit adds a new configuration key:

    spring.http.encoding.mapping.<locale>=<charset>

This allows to specify which default charset should be used for any
given Locale, if none has been provided already in the response itself.
This applies to all supported embedded servlet containers.

Fixes gh-6453
2016-07-26 12:17:11 +02:00
Phillip Webb 496b3a8d75 Relocate FileWriters to `spring-boot`
Move ApplicationPidFileWriter and EmbeddedServerPortFileWriter to the
core spring-boot project since they're not really tied to the actuator.

Fixes gh-6398
2016-07-25 13:45:29 -07:00
Phillip Webb 254b099bfd Polish 2016-07-25 10:23:35 -07:00
Phillip Webb b615070535 Merge branch '1.3.x' 2016-07-25 10:20:57 -07:00
Phillip Webb 8e22f47916 Don't limit collection sizes in property binding
Update PropertiesConfigurationFactory so that collections can grow
beyond 256 items. Prior to this commit configuration property binding
used the default `DataBinder.autoGrowNestedPaths` setting of 256.

Fixes gh-6436
2016-07-25 10:13:24 -07:00
Andy Wilkinson a1797879e6 Add a FailureAnalyzer for BeanNotOfRequiredTypeException
Closes gh-6434
2016-07-21 16:26:24 +01:00
Phillip Webb b6fd1b515d Add `/` consistently in logback base.xml
Update logback `base.xml` so that both `LOG_PATH` and `LOG_TEMP` can
be specified without a trailing slash.

Fixes gh-6423
2016-07-19 12:49:58 -07:00
Phillip Webb 05ff4ed4e0 Upgrade to Tomcat 8.5.4 & remove tomcat-juli
Upgrade the managed Tomcat dependency to 8.5.4 and remove `tomcat-juli`
since it's now included in `tomcat-embed-core`.

Fixes gh-6192
2016-07-18 17:52:35 -07:00
Christoffer Sawicki 150aba2191 Add support for engine valves
Update TomcatEmbeddedServletContainerFactory to allow registration of
engine valves as well as context values. For clarity the ambiguous
`getValues()` method has been deprecated in favor of
`getContextValves()`

See gh-6311
2016-07-18 15:37:34 -07:00
Max Stoliar 219df8dc25 Fixed ServletContextInitializer documentation
Closes gh-6410
2016-07-18 15:13:25 -07:00
Phillip Webb 8bf3f275c9 Merge branch '1.3.x' 2016-07-18 14:35:56 -07:00
Phillip Webb 49676ee986 Polish 2016-07-18 14:31:23 -07:00
Phillip Webb 2cb38bc8e2 Apply Log4J2LoggingSystem.FILTER to main config
Update Log4J2LoggingSystem so that the FILTER is applied to the main
configuration and not to the root logger. Prior to this commit calls
to `logger.isErrorEnabled()` would not consider the filter and hence
would always return `true`. This caused `SpringApplication` to silently
swallow exceptions.

Fixes gh-5271
2016-07-18 14:26:11 -07:00
Phillip Webb 3b0b65cafc Fix deprecation warning 2016-07-18 13:05:19 -07:00
Phillip Webb ef6139be63 Refactor from deprecated getAliasedStringArray
Update ServletComponentScanRegistrar to make use of Spring Framework's
updated alias support with ASM reading.

See gh-6337
2016-07-18 11:26:57 -07:00
Stephane Nicoll 1d5549ff01 Merge complex types from multiple source correctly
Update PropertySourcesPropertyValues so that source detection logic for
collection values also considers complex types. Prior to this commit
properties of the following form were processed correctly:

	PropertySource-A
	  list[0]=x

	PropertySource-B
	  list[0]=y
	  list[1]=z

But properties of the form were not:

	PropertySource-A
	  list[0].name=x

	PropertySource-B
	  list[0].name=y
	  list[1].name=z

Fixes gh-4313
See gh-2611
2016-07-13 15:27:01 -07:00
Phillip Webb e6f6e83c39 Polish 2016-07-13 11:17:59 -07:00
Phillip Webb d9e8676f77 Merge branch '1.3.x' 2016-07-13 10:48:02 -07:00
Phillip Webb fd6c0029dc Formatting 2016-07-13 10:44:37 -07:00
Andy Wilkinson f84f31b47d Add setReadTimeout and setConnectTimeout to RestTemplateBuilder
Closes gh-6346
2016-07-13 16:40:32 +01:00
Dave Syer 9fdef15d50 Merge branch '1.3.x' 2016-07-13 16:06:38 +01:00
Dave Syer af426d0856 Be more defensive about a null password in Undertow SSL
Fixes gh-6387
2016-07-13 15:36:55 +01:00
Andy Wilkinson 18d99245dd Merge branch '1.3.x 2016-07-12 09:17:03 +01:00
Andy Wilkinson c2db9fa385 Update admin MBean to only be ready when its own context is ready
Previously, if there was a hierarchy of SpringApplications, the admin
MBean would report that the application was ready as soon as any
application in the hierarchy was ready. This could lead to a client
trying to query a property in the environment before it's available.

This commit updates the MBean registrar to that the MBean only reports
that the application is ready when the context that contains the
registrar has refreshed and fired its ApplicationReadyEvent.

Closes gh-6362
2016-07-12 09:13:36 +01:00
Phillip Webb 629ce6a527 Clarify @EntityScan deprecated Javadoc
Closes gh-6340
2016-07-07 14:16:30 -07:00
Stephane Nicoll 0356be7b95 Refine AliasFor usage
This commit makes sure to use `getAliasedStringArray` rather than
`getStringArray` as the latter does not work with ASM. While this will
probably be fixed in the core framework, this commit also adds dedicated
tests with ASM to ensure that the code works as expected.

Closes gh-6337
2016-07-07 11:47:24 +02:00
Phillip Webb f10286caf1 Fix spring.profiles.default with profile enabled by configuration file
Previously, if the user configured a custom default profile and then
enabled another profile using a configuration file, the custom default
profile would be activated when it should not have been.

This commit updates ConfigFileApplicationListener so that when a
profile is activated via a configuration file, any profiles
that are queued purely because they are a default profile are removed
from the queue. This ensures that a default profile is not active
when another profile is activated via a configuration file.

Closes gh-5998
2016-07-05 09:41:11 +01:00
Spring Buildmaster 2216369348 Next Development Version 2016-07-04 14:15:02 +00:00
Matt Benson 687199e688 Add an accessor for webEnvironment to SpringApplication
Closes gh-6241
2016-07-01 10:59:17 +01:00
Andy Wilkinson 92bb24e365 Avoid synchronizing on this and use an internal monitor instead
Where possible, code that previously synchronized on this (or on the
class in the case of static methods) has been updated to use an
internal monitor object instead. This allows the locking model that's
employed to be an implementation detail rather than part of the
class's API.

Classes that override a synchronized method continue to declare
the overriding method as synchronized. This ensures that locking
is consistent across the superclass and its subclass.

Closes gh-6262
2016-07-01 10:44:23 +01:00
Andy Wilkinson 76c4a38e65 Merge branch '1.3.x' 2016-06-30 16:05:16 +01:00
Andy Wilkinson 02e989c863 Check that URL is actually a file URL before getting a File from it
Previously, Log4J2LoggingSystem used ResourceUtils.isFileURL(URL) to
check that the URL of the configuration was suitable for accessing as a
File. Unfortunately, this fails when the URL’s protocol is vfs or
vfsfile as both return true and then fail when the URL is subsequently
passed into ResourceUtils.getFile(URL).

This commit switches to checking that the URL’s protocol is file,
the only protocol that will allow getFile(URL) to succeed.

Closes gh-6246
2016-06-30 15:55:22 +01:00
Andy Wilkinson 2b970f9efc Allow Tomcat context root redirect to be configured via the environment
This commit adds a new property, server.tomcat.redirect-context-root,
that can be used to configure the Tomcat Context’s 
mapperContextRootRedirectEnabled property. The default is to not apply
any configuration and, therefore, to use Tomcat’s default of true.

Closes gh-6248
2016-06-30 12:47:42 +01:00
Phillip Webb 4d50b4d321 Defer javax.servlet.Filter initialization
Update `DelegatingFilterProxyRegistrationBean` so that calls to the
`init()` method no longer trigger early bean initialization.

See gh-6178
2016-06-29 20:13:58 -07:00
Phillip Webb be884d4e33 Polish 2016-06-29 10:57:43 -07:00
Phillip Webb 266445aaf0 Polish 2016-06-29 10:44:33 -07:00
Stephane Nicoll 669da59b4a Polish 2016-06-29 16:28:41 +02:00
Stephane Nicoll f54bec835d Move BasicAuthorizationInterceptor
`BasicAuthorizationInterceptor` is now available in the core framework
and this commit uses that instead of the outdated copy in Boot.

Closes gh-6237
2016-06-29 08:07:30 +02:00
Stephane Nicoll 3151df624a Fix build failure 2016-06-27 12:12:07 +02:00
Stephane Nicoll 6631136f91 Merge branch '1.3.x' 2016-06-27 12:08:04 +02:00
Stephane Nicoll 17f8a244de Fix property names with successive capital letters
Previously, if a property name had successive capital letters, the
generated meta-data would clean it in such a way it is defined as a
regular word. For instance a `myFOO` property would be written as
`my-foo` in the meta-data.

It turns out this decision is wrong as the binder has no way to compute
back the name of the property and therefore `my-foo` wouldn't bind to
`setMyFOO` as it should.

This commit updates the meta-data name generation algorithm to properly
identify such cases: `myFOO` now translates to `my-f-o-o`. While the
generated name is a bit ugly, it now provides a consistent binding
experience.

Closes gh-5330
2016-06-27 12:02:34 +02:00
Phillip Webb e8d4d0e2b1 Drop Neo4J SessionFactoryProvider
Remove SessionFactoryProvider since it's no longer needed for
auto-configuration.

See gh-6142
2016-06-24 12:49:13 -07:00
Phillip Webb 654801083b Provide unified @EntityScan annotation
Add a new `@EntiyScan` annotation that's used by auto-configuration to:
* Set JPA packagesToScan.
* Set Neo4J's SessionFactory packages.
* Set the initial entity set for Spring Data MongoDB, Cassandra and
  Couchbase mapping contexts.

Additionally deprecate `@org.springframework.boot.orm.jpa.EntityScan`.

See gh-6142
2016-06-24 12:49:12 -07:00
Phillip Webb 5d59193a09 Remove @NodeEntityScan annotation
Remove `@NodeEntityScan` in preparation for a unified `@EntityScan`
annotation.

See gh-6142
2016-06-24 12:49:12 -07:00
Dave Syer 13ceea5bba Fix binary compatibility issue
Existing apps get a NoSuchMethodError before this change because
they were compiled expecting a different signature for the
deprecated FilterRegistrationBean constructor.
2016-06-22 08:46:52 +01:00
Andy Wilkinson 52e8ad4b6b Drop back to Hibernate 5.0.9.Final
The upgrade to Hibernate 5.2.0.Final has provide to be too
problematic to live with. It requires Java 8, is incompatible with
a number of other projects in the Hibernate ecosystem, and it's
unclear for how long it will be maintained. We'd previously used
Hibernate 5.1.0.Final but its maintenance is also unclear with
Hibernate 5.1.1.Final being more than 3 months overdue.

This commit drops back to Hibernate 5.0.9.Final. This has a few
advantages:

- It's Java 7 compatible
- It's had some time to mature and should be reasonably free of
  regressions for those moving from 4.3.x
- It's used in both Wildfly and JBoss EAP so there's a fair chance
  that it will continue to be maintained.

Closes gh-6198
2016-06-21 20:09:21 +01:00
Phillip Webb 7446235ff4 Polish 2016-06-20 20:13:13 -07:00
Phillip Webb c136054e69 Merge branch '1.3.x' 2016-06-20 18:54:01 -07:00
Phillip Webb 5b97981c87 Polish 2016-06-20 18:13:43 -07:00