Commit Graph

874 Commits (ea84479e9a27640d8449c2f3a2dd2e8fd420b608)

Author SHA1 Message Date
Andy Wilkinson e57b0e00f2 Use ServletContainerInitializers to start servers
The Servlet spec prohibits ServletContextListeners from being registered
programatically other than from with a call to
`ServletContainerInitializer.onStartup`. This restriction is not
consistently enforced by the various embedded servlet containers that
Boot supports:

- Jetty 8 does not enforce the restriction.
- Jetty 9 enforces the restriction. We were working around it be calling
  setExendedListenerTypes(true) on the context.
- Tomcat somewhat enforces the restriction: it doesn't allow a
  ServletContextListener to be added once the first
  ServletContextListener has been called. We were using a
  LifecycleListener to drive the ServletContextListeners.
- Undertow enforces the restriction and we were not working around it.
  This resulted in gh-2192 being raised.

ServletListenerRegistrationBean is a ServletContextListener and is used
to register listeners, including ServletContextListeners, with the
servlet context. To adhere to the letter of the servlet spec this means
that ServletListenerRegistrationBeans need to be called from with
ServletContainerInitializer.onStartup. This commit updates all of the
embedded servlet container implementations to use a
ServletContainerInitializer to drive any ServletContextInitializers.

This makes the lifecycle more consistent across the supported containers
and allows ServletListenerRegistrationBeans to be able to register
ServletContextListeners on all supported embedded containers.

Fixes gh-2192
10 years ago
Phillip Webb 82bf60400a Fix OnPropertyCondition no havingValue message
See gh-2193
10 years ago
Phillip Webb 1da918f388 Fix TypeNotPresentExceptionProxy error with Mongo
Update MongoAutoConfiguration so that a TypeNotPresentExceptionProxy
error is not thrown when Spring Data Mongo is not used.

Fixes gh-2196
10 years ago
Phillip Webb bfa984ccd5 Fix PersistenceExceptionTranslation INFO message
Update PersistenceExceptionTranslationAutoConfiguration so that the
PersistenceExceptionTranslation @Bean method is static.

Fixes gh-2210
10 years ago
Phillip Webb 8d12130a2b Add `exclude` attribute to @SpringBootApplication
Fixes gh-2207
10 years ago
Stephane Nicoll 9a55cc49b5 Fix typo 10 years ago
Phillip Webb 0f3b959686 Scan full classpath with /templates checks
Update template auto configurations to search for template folders in
the entire classpath rather than just the root jar.

Fixes gh-2184
10 years ago
Phillip Webb 7e7acea548 Don't check for /templates when using groovy-all
Update GroovyTemplateAutoConfiguration so that the `/template`
folder check only occurs when the groovy-all jar is not being
used.

Fixes gh-2190
See gh-1915
10 years ago
Michael Cramer 3b858edfa9 Auto-configure for Thymeleaf conditionalcomments
Add auto-configuration for thymeleaf-extras-conditionalcomments which
allows parsing of conditional comments for IE.

Example:

	<!--[if lt IE 8]>
		<link rel="stylesheet" th:href="@{/styleIE.css}"
		type="text/css"/>
	<![endif]-->

Without this dialect all Thymeleaf attributes are ignored inside the
comment.

Fixes gh-2113
10 years ago
izeye 3784959b6f Rename SecurityPrequisite -> SecurityPrerequisite
Closes gh-2179
10 years ago
Dave Syer 80d55c4720 Additional condition to protect Reactor 2.0 users 10 years ago
Phillip Webb 917723a883 Automatically alias MultipartResolver beans
Update DispatcherServletAutoConfiguration to alias a MultipartResolver
that is not named correctly. This allows the DispatcherServlet to pick
up any MultipartResolver bean, regardless of its name.

See gh-2162
10 years ago
Phillip Webb 4293b7b797 Ensure CharacterEncodingFilter is ordered highest
Update HttpEncodingAutoConfiguration to ensure that the
CharacterEncodingFilter is ordered above any HiddenHttpMethodFilter.

Fixes gh-2148
10 years ago
Spring Buildmaster 1a788c1741 Next development version 10 years ago
Phillip Webb c678c1f788 Polish 10 years ago
Oliver Gierke 034ce0ad89 Setup MongoMappingContext setInitialEntitySet
Update MongoDataAutoConfiguration to set the MongoMappingContext
initialEntitySet by scanning for @Document or @Persistent classes
from AutoConfigurationPackages.

Fixes gh-2107
10 years ago
Dave Syer 8a5f151e47 Add spring.*.enabled for MVC view resolvers
Since we use a composite ViewResolver glbally by default it can be
awkward to switch off the view technology that you have on the classpath
but aren't actually using.
10 years ago
Phillip Webb 9c66624deb Polish 10 years ago
Phillip Webb 2f03351cf6 Fix auto-configuration order for Spring Data Rest
Update Rest, Hypermedia and HttpMessageConverter auto-configuration to
ensure beans are created in the correct order.

Prior to this commit the MappingJackson2HttpMessageConverter bean would
not be created because Spring Data Rest's TypeConstrained versions had
already been registered.

Fixes gh-1729
10 years ago
Sebastien Deleuze 27d9d7fd55 Add support for autowired Jackson handlers
Inject the ApplicationContext into Jackson2ObjectMapperBuilder to allow
Jackson handlers to be autowired. See SPR-10768.

Fixes gh-2081
10 years ago
Phillip Webb 7ae75c2707 Merge branch '1.1.x' 10 years ago
Phillip Webb fcad7c4fde Guard for null BeanFactory in @ConditionalOnBean
See gh-2080
10 years ago
Phillip Webb 1f66277fd6 Fix JmsProperties bean not found exception
Update JndiConnectionFactoryAutoConfiguration to ensure that the
JmsProperties bean is created. Prior to this commit deployment to
a WildFly would fail with a NoSuchBeanDefinitionException.

Fixes gh-2072
10 years ago
Phillip Webb 778aa39016 Add Undertow WebSocket auto-configuration
Fixes gh-2028
10 years ago
Phillip Webb 211f20b9c6 Add setIgnoreDefaultModelOnRedirect support
Add a `spring.mvc.set-ignore-default-model-on-redirect` property to
allow RequestMappingHandlerAdapter.setIgnoreDefaultModelOnRedirect to
be easily customized and change the default value to 'true'.

Fixes gh-2018
10 years ago
Phillip Webb 447c9ff204 Polish 10 years ago
Maciej Walkowiak c74e56d185 Apply pubSubDomain property to ContainerFactory
Previously, tuning the pubSubDomain flag only impacted the created
JmsTemplate leaving any default listeners with the default settings.

If no default JmsListenerContainerFactory is defined, the created
one is using that property as well now.
10 years ago
Andy Wilkinson f9b5c6b1ae Merge branch '1.1.x' 10 years ago
Andy Wilkinson 3b78aa9493 Make Security auto-config conditional on spring-security-config
SecurityAutoConfiguration, via its import of
AuthenticationManagerConfiguration, requires spring-security-config
to be on the classpath as AuthenticationManagerConfiguration extends
GlobalAuthenticationConfigurerAdapter from spring-security-config.

This commit makes SecurityAutoConfiguration conditional on the
presence of GlobalAuthenticationConfigurerAdapter so that the
auto-configuration will be disabled in its absence rather than causing
an app to fail to start.

Closes gh-2046
10 years ago
Andy Wilkinson 064f88a9fb Use a free port, rather than 8080, in WebSocketAutoConfigurationTests
Closes gh-2043
10 years ago
Phillip Webb 09dac5ff00 Apply formatting and cleanup rules 10 years ago
Phillip Webb 48db5457f1 Polish 10 years ago
Dave Syer 911d39f937 Ensure authentication events get published
When the user provides their own AuthenticationManager we do a lazy
initialization and didn't (till now) inject the AuthenticationEventPublisher

Fixes gh-2033
10 years ago
Stephane Nicoll 1a5916665c Remove unused RabbitMQ dynamic property flag
Fixes gh-1999
10 years ago
Stephane Nicoll 65e9d6a6e0 Add property description
Set the field javadoc of many properties that are managed via
configuration so that the "description" field is available in the
meta-data.

Closes gh-1808
10 years ago
Andy Wilkinson 40a7445fec Merge branch '1.1.x' 10 years ago
Andy Wilkinson 64599261a5 Allow mongo port, host, and credentials to be configured individually
Previously, the host had to have a custom value for the configuration
of the port or credentials (username and password) to take effect. This
meant, for example, that you couldn’t just set the port or just set the
username and password while using the default host.

This commit allows the port or username and password to be configured
without also configuring the host. The default host (localhost) and
port (27017) are retained.

Fixes gh-2008
10 years ago
Oliver Gierke 123b90fa64 Register all packages where @EnableAutoConfiguration is used
Previously, when @EnableAutoConfiguration was used in multiple packages,
the last @EnableAutoConfiguration that was processed would
win and only its package would be stored as an auto-configuration
package.

This commit updates AutoConfigurationPackages to allow multiple package
name registrations. AutoConfigurationPackages.set(…) has been altered to
augment the constructor arguments of the BeanDefinition registered for
the initial call to the method so that the packages handed to the method
call will be added to the bean definition and not replace the previous
ones. The method has been renamed register(…) to reflect the changed
behavior.

Closes gh-1994
10 years ago
Andy Wilkinson d5b7f49f83 Merge branch '1.1.x' 10 years ago
Andy Wilkinson 9270303a9a Remove double “and” from DataSourceInitializer’s javadoc 10 years ago
Andy Wilkinson d5ad502d31 Disable Undertow auto-config if required XNIO classes are unavailable
Fixes gh-1986
10 years ago
Dave Syer 9f7bd0cddc Inject ResourceConfig instance (not class) into Jersey
If you inject the class (via a servlet parameter) it seems that
Jersey tries to create all the beans for you (and fails). I thought
it was supposed to work (according to the docs), so I'm a bit confused
but the sample now has Spring DI and the tests pass.

Fixes gh-1981
10 years ago
Phillip Webb 2a9a749329 Polish 10 years ago
Dave Syer 5b044356dc Clarify the deprecation status of HttpMapperProperties 10 years ago
Phillip Webb 70a1438c6f Don't replace MappingJackson2HttpMessageConverter
Guard against Spring Data REST TypeConstrained Jackson converters
replacing the default MappingJackson2HttpMessageConverter.

Fixes gh-1968
10 years ago
Phillip Webb bf0629522c Only use Gson if Jackson is missing
Update HttpMessageConvertersAutoConfiguration to only register Gson
support when Jackson is not on the classpath.

Fixes gh-1967
10 years ago
Phillip Webb 2b57c5a4dd Rename spring.data.mongo.repositories.enabled
Rename mongo to mongodb.

Fixes gh-1966
10 years ago
Phillip Webb 670ba33bec Improve MongoDataAutoConfiguration
Update MongoDataAutoConfiguration to provide easier configuration of
CustomConversions, the MappingMongoConverter, MongoMappingContext
and an authentication database.

Fixes gh-1619
Fixes gh-1730
10 years ago
Phillip Webb 2a8579026f Polish 10 years ago
Stephane Nicoll 11894a5412 Fix manual metadata format inconsistency
Fixes gh-1961
10 years ago