Commit Graph

828 Commits (1f775793ee3c93b696ffea79e0761a56d5a7084e)

Author SHA1 Message Date
Phillip Webb 1f775793ee Use Collections.addAll(...) instead of for loops
Replace various for loops which add items to collections with calls
to Collections.addAll(...).

Fixes gh-2277
10 years ago
Phillip Webb 6333d4c617 Merge branch '1.1.x'
Conflicts:
	spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfiguration.java
	spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/ParentAwareNamingStrategy.java
	spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java
10 years ago
Phillip Webb 7e771bb655 Fix ParentAwareNamingStrategy and JMX auto-config
Fix ParentAwareNamingStrategy to set ObjectName properties for the
'identity' and 'context' attributes. Also update JmxAutoConfiguration
to ensure that the ParentAwareNamingStrategy is created in each context
and that the `mbeanExporter` bean is created. Prior to this commit the
nested @EnableMBeanExport class always meant that the mbeanExporter
condition never matched.

Fixes gh-2243
10 years ago
Phillip Webb 4616be9e91 Merge branch '1.1.x'
Conflicts:
	spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfigurationTests.java
10 years ago
Phillip Webb c46478f97d Guard for multiple ContentNegotiatingViewResolvers
Update WebMvcAutoConfiguration to ensure than the viewResolver bean
is not created if a user defined ContentNegotiatingViewResolver bean
is defined.

Fixes gh-2269
10 years ago
Dave Syer f4e12e96c6 Additional condition to protect Reactor 2.0 users
(cherry picked from 80d55c47)
Closes gh-2255
10 years ago
Phillip Webb 0735d6e259 Fix TemplateLocation.anyExists logic
Fix broken logic in TemplateLocation.anyExists caused by not using the
local `searchPath` variable.

See gh-2184
Closes gh-2248
10 years ago
Phillip Webb d7a12a8791 Remove superfluous semi-colons 10 years ago
Phillip Webb 0702b4e7e3 Merge branch '1.1.x'
Conflicts:
	spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java
	spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java
10 years ago
Phillip Webb 96d479c3d9 Make RequestMappingHandlerMapping @Primary
Update WebMvcAutoConfiguration so that the RequestMappingHandlerMapping
bean is @Primary. Prior to this commit a NoUniqueBeanDefinitionException
would be thrown then using the MvcUriComponentsBuilder.

Fixes gh-2237
10 years ago
Phillip Webb b42c7fca64 Polish 10 years ago
Phillip Webb 291a8d422b Fix incorrect BitronixJtaConfiguration bean name
Fixes gh-2231
10 years ago
Phillip Webb 8628adcb74 Order EmbeddedServletContainerCustomizers
Add Ordered interface to all EmbeddedServletContainerCustomizers with
a value of 0. Prior to this commit it was difficult for a user to
define a customizer that would be applied before ours, even if they
implemented Ordered or added @Order annotations.

Fixes gh-2123
10 years ago
Phillip Webb ef621c9271 Protect against NoClassDefFoundError on WAS
Update HibernateJpaAutoConfiguration to catch NoClassDefFoundError when
setting the JTA_PLATFORM. The exception can occur when running on WAS
since it ships with Hibernate 4.2 and SpringJtaPlatform extends from
AbstractJtaPlatform which is not present.

The exception is now ignored if a JDNI environment is available,
otherwise it is re-thrown.

Fixes gh-2218
10 years ago
Phillip Webb fd97c7553c Apply HATEOAS module to primary ObjectMapper
Update HypermediaAutoConfiguration to apply the Jackson2HalModule to
the primary ObjectMapper. This restores the behavior of Spring Boot
1.1 where HATEOAS types could be serialized for both `application/json`
and `application/json+hal` content types.

A `spring.hateoas.apply-to-primary-object-mapper` property has also been
provided to opt-out if necessary.

Fixes gh-2147
10 years ago
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
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