Commit Graph

99 Commits

Author SHA1 Message Date
Dave Syer
17e24fd17d Add extra test for placeholder behaviour 2013-10-14 11:16:00 -04:00
Dave Syer
d60ba48de0 Fix bug in RelaxedPropertyResolver with prefix ending in separator
E.g. with a prefix spring.jpa.hibernate. we want naming-strategy and
namingstrategy to be resolvable. It wasn't working before this change
because the whole property path was being manipulated, where you
actually need to manipulate the prefix and suffix separately.
2013-10-10 13:15:21 -04:00
Dave Syer
68da5b41c6 Allow relaxed names to include prefixes 2013-10-10 13:15:21 -04:00
Dave Syer
a7d12bfddb Add FileEncodingApplicationContextInitializer
Looks for spring.mandatory_file_encoding and matches it against
System.getProperty("file.encoding").

Fixes gh-46
2013-10-10 13:15:21 -04:00
Dave Syer
b8bdf22209 Don't repeat relaxed names that already showed up 2013-10-10 13:15:21 -04:00
Dave Syer
2c60828cf2 Ensure ServerProperties default values does not override
Since ServerProperties had primitive properties for port (in
particular) it was not possible to check when applying those
properties if the user had actually changed the value. This
in turn meant that a custom EmbeddedServletContainerFactory
could not set the default values.

Fixed by making int properties of ServerProperties into
Integer and checking for null before setting on the
container factory.

Fixes gh-84
2013-10-10 09:46:14 -04:00
Phillip Webb
af0d08c998 Polish 2013-10-08 21:17:39 -07:00
Dave Syer
4655eb3a94 Expose SpringApplicationBuilder in SpringBootServletInitializer 2013-10-08 11:04:45 -04:00
Dave Syer
6cd060c4cf Fix deployable WAR (Servlets have to be registered)
Includes smart guess for prepending servlet context initializer
in SpringApplicationBuilder.
2013-10-08 11:04:45 -04:00
Dave Syer
1be040170c Fix bug with ordering of property sources
Profile-specific property sources were being added last,
*after* the global values, which means they did not
override in the way that users would expect.

Fixed by storing the global property sources in an
intermediate list and applying them after the profile
specific ones.
2013-10-07 09:11:05 -04:00
Dave Syer
a082f2bed5 Investigating 2013-10-07 08:15:58 -04:00
Dave Syer
5fe9ef69c7 Add SpringApplicationContextLoader 2013-10-02 15:07:04 -04:00
Dave Syer
eabb1e70a4 Refine SpringApplicationBuilder and add a test for profiles 2013-10-02 08:35:17 -04:00
Dave Syer
345c0fc5a4 Add SpringApplicationBuilder
Builder for SpringApplication and ApplicationContext instances with
convenient fluent API and context hierarchy support. Simple example
of a context hierarchy:

   new SpringApplicationBuilder(ParentConfig.class)
               .child(ChildConfig.class).run(args);

Another common use case is setting default arguments, e.g.
active Spring profiles, to set up the environment for an application:

     new SpringApplicationBuilder(Application.class).profiles("server")
 		.defaultArgs("--transport=local").run(args);

If your needs are simpler, consider using the static convenience
methods in SpringApplication instead.

[#49703716] [bs-116] Parent context for some beans maybe?
2013-10-02 07:06:12 -04:00
Dave Syer
5b1503d07d Extract DispatcherServletAutoConfiguration so it can be used independently 2013-10-02 06:39:28 -04:00
Phillip Webb
1bdb2ce1c2 Polish 2013-09-30 09:50:38 -07:00
Dave Syer
be1c279be6 Add connector to service before calling customizers 2013-09-27 11:13:02 -04:00
Dave Syer
c661a74c75 Add TomcatConnectorCustomizer
... and ServerProperties.Tomcat.maxThreads to conveniently
limit the thread pool size in the Connector.
2013-09-26 19:19:15 -04:00
Phillip Webb
e16a0278ae Support single config from ServletInitializer
Update SpringBootServletInitializer with separate getConfigClass() and
getAdditionalConfigClasses() methods. This change makes it easier to
use the SpringBootServletInitializer with the common use case of a
single config class.
2013-09-25 20:58:27 -07:00
Dave Syer
abb1420486 Fixes #55: stop() connector to unbind socket
The `Tomcat.start()` has to happen to initialize the `ServletContext`
but we can immediately stop the connector and then restart it when
the context is finished refreshing. Seems to make curl fail quickly
if an app is slow to start.
2013-09-20 18:16:03 +01:00
Dave Syer
3c4f1a7a6f Fixes #54: stop servlet container if context fails to start 2013-09-20 16:38:26 +01:00
Dave Syer
04ba4d064e Investigating failing tests 2013-09-20 15:38:49 +01:00
Dave Syer
ef79d63544 Fix #40: extra catch block in BeanDefinitionLoader 2013-09-14 11:23:44 -07:00
Dave Syer
a9113d58a3 Bootstrap->Boot in startup log
[Fixes #56812760] [bs-319] Spring bootstrap in log message
2013-09-12 08:46:46 -07:00
Dave Syer
191894a16a Add Mongo auto configuration
Spring Data Mongo is the only dependency so it doesn't
really need a new starter. Added a sample though.
2013-09-11 09:53:36 -07:00
Dave Syer
2b1f629761 Make ConfigurationPropertiesBindingPostProcessor Ordered 2013-09-05 17:15:16 -07:00
Dave Syer
759aa785a7 Fix bug in datasource autoconfiguration
The AbstractDataSourceConfiguration had path= in its
@ConfigurationProperties by mistake (should have been value)
2013-09-05 17:15:16 -07:00
Dave Syer
8c7c5d4dc9 Widen net for errors in vcap initializer 2013-09-05 17:15:15 -07:00
Dave Syer
38e565e920 Back to SNAPSHOT for dev 2013-09-05 17:15:15 -07:00
Dave Syer
b634b3bde6 Update to 0.5.0.M2 2013-09-05 17:15:15 -07:00
Phillip Webb
2c94dcdc8c Polish 2013-09-05 17:14:16 -07:00
Phillip Webb
0d75995aed Polish JSR-303 detection 2013-09-05 17:14:14 -07:00
Phillip Webb
1434c83694 Fix NoClassDefFoundError with OutputCapture 2013-09-05 17:14:14 -07:00
Phillip Webb
8682d7a829 Use OutputCapture for log tests and disable ANSI
Refactor JavaLoggerSystemTests to make use of OutputCapture and ensure
that captured output never includes ANSI symbols.
2013-09-05 17:14:13 -07:00
Adrian Pillinger
f15eed6f02 Fixing typo in the documentation that incorrectly named a property.
The spring property should have been spring.profiles.active instead of
spring.active.profiles.
2013-09-05 17:14:13 -07:00
Phillip Webb
f7ce153ff0 Fix JSP EL support with Tomcat
Fix TomcatEmbeddedServletContainerFactory to set a MERGED_WEB_XML
attribute when JSPs are used. This is required for EL support with
JSPs since Jasper checks the version number in the web.xml. Without
any web.xml Jasper default to disabling EL.

Issue: #55752948
2013-09-05 17:14:13 -07:00
Phillip Webb
1db12f5912 Delegate ClassLoader with Tomcat
Use standard class loading delegation with Tomcat.
2013-09-05 17:14:13 -07:00
Phillip Webb
37d136dcb6 Add config file property sources after existing
Change ConfigFileApplicationContextInitializer to add config file
property sources after existing sources. This allows environment
variables and system properties to override file properties.

Issue: #55739594
2013-09-05 17:14:13 -07:00
Phillip Webb
6edc7570c1 Added 'Application started in XX seconds' logging
Added logging to INFO SpringApplication to log when the application has
fully started and how long it took to load.
2013-09-05 17:14:12 -07:00
Phillip Webb
cbb95e3e25 Update logging to check level is enabled 2013-09-05 17:14:12 -07:00
Phillip Webb
0fa0082b2a Support for liquibase in executable jars
Create LiquibaseServiceLocatorInitializer to replace the standard
liquibase classpath scanning logic with SpringPackageScanClassResolver
which will work correctly in Spring Boot packaged executable JARs.

Issue: #55580628
2013-09-05 17:14:12 -07:00
Phillip Webb
5e6260ec5a Polish pattern resolving in BeanDefinitionLoader 2013-09-05 17:14:12 -07:00
Phillip Webb
be79da139e Code formatting 2013-09-05 17:14:12 -07:00
Phillip Webb
0a7ac89984 Create RelaxedPropertyResolver
Create RelaxedPropertyResolver class that can be used to get values
from another PropertyResolver (probably an Environment) using the
same relaxed rules as the RelaxedDataBinder.

The commit extracts the relaxed naming rules from RelaxedDataBinder
into a new RelaxedNames class.

Issue: #55621278
2013-09-05 17:14:11 -07:00
Sergey Shcherbakov
0277ce7ab2 Added wildcard and property placeholder support in SpringApplication
* When a config source is a String it can now be a pattern
* Default resource loaded in the BeanDefinitionLoader has been
changed to PathMatchingResourcePatternResolver;
* A check for the ResourcePatternLoader similar to that in
AbstractBeanDefinitionReader and property placeholder resolution
has been added to the load(CharSequence) method of the
BeanDefinitionLoader;
* Added a unit test illustrating the issue;
2013-09-05 17:14:10 -07:00
Dave Syer
6e8cbbde3b Use reflection hack for error page in Tocmat 8 2013-09-05 17:14:10 -07:00
Biju Kunjummen
9d9b005c9f Fixed typo in LoggingApplicationContextInitalizer initializeLogLeve->initializeLogLevel 2013-09-05 17:14:09 -07:00
Phillip Webb
a10abffe9f Add MultiPartConfigFactory
Issue: #55528242
2013-09-05 17:14:09 -07:00
Phillip Webb
d4fe320254 Update trace logging to include Hibernate SQL 2013-09-05 17:14:09 -07:00
Dave Syer
bd45d68a63 Rename SpringServletInitializer
[Fixes #55388726] [bs-292]
2013-09-05 17:14:08 -07:00