Commit Graph

12151 Commits

Author SHA1 Message Date
Juergen Hoeller
f108deb114 (Reloadable)ResourceBundleMessageSource allows for adding resources
This turned into the extraction of a common AbstractResourceBasedMessageSource base class which not only features addBasenames but also getBasenameSet and setCacheMillis.

Issue: SPR-10314
2016-02-04 19:57:40 +01:00
Juergen Hoeller
28e8af2e2e AbstractXlsView does not explicitly flush (for compatibility with WebSphere Liberty)
Issue: SPR-13910
2016-02-04 19:48:05 +01:00
Sam Brannen
81f68463ec Clean up warnings in Gradle build 2016-02-03 18:42:30 +01:00
Sam Brannen
677a321571 Support primary TxMgrs and DataSources in the TCF
Prior to this commit, the transaction manager and data source look-up
algorithms in the Spring TestContext Framework were not capable of
retrieving 'primary' beans of those types, even though 'primary' beans
are supported in production as well as for injecting dependencies into
test instances. Specifically, if there was more than one transaction
manager or data source bean and one of them was flagged as 'primary',
the retrieveTransactionManager() and retrieveDataSource() methods in
TestContextTransactionUtils would simply return null for such beans.

This commit updates TestContextTransactionUtils by adding support for
looking up primary transaction managers and data sources.

Issue: SPR-13891
2016-02-03 17:58:33 +01:00
Sam Brannen
6d2b9a0136 Throw exception if TxMgr cannot be retrieved for @Transactional test
Prior to this commit, a @Transactional integration test would silently
be executed without a transaction if the transaction manager could not
be retrieved from the application context -- for example, it no such
bean was defined or if multiple beans were present but none satisfied
the qualifier.

This commit addresses this issue by throwing an IllegalStateException
if the PlatformTransactionManager cannot be retrieved for a
@Transactional test.

Issue: SPR-13895
2016-02-03 14:56:27 +01:00
Rob Winch
d6648a06c9 Add Code of Conduct 2016-02-01 14:37:35 -06:00
Rossen Stoyanchev
e81c7dfc4c Polish SendToMethodReturnValueHandlerTests 2016-01-29 16:16:21 -05:00
Rossen Stoyanchev
03e3ef53ab @SendToUser supported on the class level
Issue: SPR-12047
2016-01-29 16:10:02 -05:00
Rossen Stoyanchev
bedf1a9bd0 Polish UriTemplateTests 2016-01-29 15:39:02 -05:00
Rossen Stoyanchev
f5aa011722 UriComponents support for array query params
Issue: SPR-9712
2016-01-29 15:32:42 -05:00
Rossen Stoyanchev
aa064d7653 Polish MVC config tests 2016-01-29 14:58:32 -05:00
Rossen Stoyanchev
1cf0fb8174 Shared custom argument resolvers
Custom argument resolvers configured in the MVC Java config or the
MVC namespace are now injected in both the RequestMappingHandlerAdapter
as well as in the ExceptionHandlerExceptionResolver.

Issue: SPR-12058
2016-01-29 14:49:25 -05:00
Sam Brannen
ea46ad8022 Clean up warnings in spring-test 2016-01-28 19:27:53 +01:00
Sam Brannen
3cf5cfd672 Fix Javadoc 2016-01-28 19:00:37 +01:00
Sam Brannen
468f083ab0 Use proper syntax highlighting for XML examples 2016-01-28 19:00:37 +01:00
Brian Clozel
d157ce598b Upgrade to undertow 1.3.15.Final 2016-01-28 18:52:40 +01:00
Stephane Nicoll
aed56ea732 Upgrade to Caffeine 2.1.0 2016-01-28 16:50:29 +01:00
Stephane Nicoll
ccbfd44862 Merge pull request #949 from bclozel/sonarplugin
* pr/949:
  Use the official SonarQube Gradle plugin
2016-01-27 10:32:30 +01:00
Brian Clozel
0ecede028c Use the official SonarQube Gradle plugin
Since the build has been upgraded to Gradle 2.10, it's showing the
following message:
"The 'sonar-runner' plugin has been deprecated and is scheduled to be
removed in Gradle 3.0. please use the official plugin from SonarQube"

This commit makes use of the "org.sonarqube" Gradle plugin and uprgrades
the Jacoco agent version to 0.7.5.

See: https://sonar.spring.io/updatecenter/updates
See: https://jira.sonarsource.com/browse/SONARJAVA-1091

Closes gh-949
2016-01-27 10:25:14 +01:00
Rossen Stoyanchev
2e7470b27f Allow binding=false on @ModelAttribute
Issue: SPR-13402
2016-01-26 23:51:18 -05:00
Rossen Stoyanchev
806e79b14b Polish 2016-01-26 23:20:58 -05:00
Rossen Stoyanchev
e62ada898b Add @RequestAttribute with servlet-based support
Issue: SPR-13894
2016-01-26 16:37:50 -05:00
Rossen Stoyanchev
698f923fc3 Add @SessionAttribute with Servlet-based support
Issue: SPR-13894
2016-01-26 16:37:44 -05:00
Juergen Hoeller
7df3a327f6 Polishing 2016-01-26 22:29:48 +01:00
Juergen Hoeller
3779fe9bf6 @UsesJava8 declaration on inner class
Issue: SPR-13850
2016-01-26 18:18:27 +01:00
Juergen Hoeller
b4f33adf48 Consistent java.util.Optional resolution, lenient handling of optional multipart files, correct Servlet 3.0 Part list/array selection
Issue: SPR-13418
Issue: SPR-13849
Issue: SPR-13850
Issue: SPR-13893
2016-01-26 18:06:15 +01:00
Juergen Hoeller
a3a5a03ee3 PropertySource annotation allows for custom encoding
Issue: SPR-13874
2016-01-26 18:00:05 +01:00
Rossen Stoyanchev
2607a22537 HTTP OPTIONS lists all HTTP methods except TRACE
This is in line with the current behavior of HttpServlet that would
have been in used with dispatchOptionsRequest on the DispatcherSerlvet
set to false (the default prior to 4.3).

Issue: SPR-13130
2016-01-25 16:35:23 -05:00
Rossen Stoyanchev
319e8e2c2f Add allowHeader property to WebContentGenerator
The WebContentGenerator now maintains an additional property that
sub-classes can use for an "Allow" header in response to an HTTP
OPTIONS request. This property is pre-initialized once at startup
and does not have to rely on getSupportedMethods in addition to
adding HTTP OPTIONS if not explicitly listed.

Issue: SPR-13130
2016-01-25 16:35:15 -05:00
Juergen Hoeller
4a0fa69ce4 Injection support for Collection/Map beans and self references
Issue: SPR-13585
Issue: SPR-12180
Issue: SPR-7915
Issue: SPR-8450
2016-01-25 21:25:48 +01:00
Juergen Hoeller
64e77de23b LocalSessionFactoryBuilder provides ClassLoader to Hibernate BootstrapServiceRegistry
Issue: SPR-13879
2016-01-25 21:02:41 +01:00
Juergen Hoeller
64ce8a81c3 Polishing 2016-01-25 20:33:48 +01:00
Juergen Hoeller
8a69159004 ConverterRegistry's addConverter declares generic type variables
Issue: SPR-12948
2016-01-25 20:33:26 +01:00
Juergen Hoeller
d18b3f049a Tests for @Enable/@ComponentScan without @Configuration
Issue: SPR-10660
2016-01-25 20:32:45 +01:00
Juergen Hoeller
c95dfca726 Log profile-based exclusion of XML bean definition file
Issue: SPR-10202
2016-01-25 20:26:12 +01:00
Juergen Hoeller
837cb752a4 Clarify component scan include-filter semantics
Issue: SPR-13844
2016-01-25 20:24:26 +01:00
Juergen Hoeller
ebad8db8d5 Clarify environment property precedence rules
Issue: SPR-13845
2016-01-25 20:23:25 +01:00
Juergen Hoeller
64d83e78ea Latest dependency updates (Hibernate ORM 5.0.7, Jetty 9.3.7, Undertow 1.3.14, SLF4J 1.7.14) 2016-01-25 20:18:54 +01:00
Rossen Stoyanchev
e14f42f386 Update reference for HTTP HEAD and OPTIONS support
Issue: SPR-13130
2016-01-25 08:49:04 -05:00
Rossen Stoyanchev
135738f9bf AbstractController supports HTTP OPTIONS
Issue: SPR-13130
2016-01-25 08:49:04 -05:00
Sebastien Deleuze
a730e55d92 Add support for Jackson 2.7
AbstractJackson2HttpMessageConverter now implements its own
TypeVariable resolution algorithm since in Jackson 2.7 it is now
deprecated and has not the same behavior .
See https://github.com/FasterXML/jackson-databind/issues/1087
for more details.

The dependency on jackson-datatype-jdk7 has been removed since
it is now provided by default in the jackson-databind module.

Issues: SPR-13483, SPR-13728
2016-01-25 09:38:16 +01:00
Rossen Stoyanchev
ccd17dfaea Support HTTP OPTIONS
Issue: SPR-13130
2016-01-24 20:18:41 -05:00
Rossen Stoyanchev
d70ad765bf Support HTTP HEAD
Issue: SPR-13130
2016-01-24 20:18:41 -05:00
Rossen Stoyanchev
fb7dfc4569 Polish 2016-01-24 20:18:35 -05:00
Brian Clozel
2b3ad218e5 Clarify RequestMappingHandlerAdapter javadoc
This commit updates the javadoc of
`RequestMappingHanderAdapter.setCacheSecondsForSessionAttributeHandlers`
to explain how one can disable that feature and prevent "Cache-Control"
directives from being added when `@SessionAttributes` annotations are
used on Controllers.

Issue: SPR-13598
2016-01-22 21:17:58 +01:00
Brian Clozel
84fe46cd43 Register prefixed path patterns with FixedVersionStrategy
Prior to this change, configuring a `FixedVersionStrategy` like so
would configure a single "/js/**" path pattern:

```
versionResourceResolver.addFixedVersionStrategy("v1.0.0","/js/**");
```

This commit makes sure that for each path pattern, its prefixed version
is added to the map. For example, the previous configuration also
adds "/v1.0.0/js/**".

Issue: SPR-13883
2016-01-22 18:30:39 +01:00
Brian Clozel
8f1d06f19c Reorder HTTP headers processing in RequestMappingHandlerAdapter
Prior to this change, the `RequestMappingHandlerAdapter` would first add
a "Cache-Control" HTTP header to the response (depending on its
`WebContentGenerator` configuration and `@SessionAttributes` on the
handler class); then, the Adapter would delegate the actual handler the
processing of the request.
This leads to issues, as the handler does not have full control to the
response and has to deal with pre-existing headers in the response. This
means that the Adapter and the handler can add incompatible
Cache-Control directives without knowing it, since one cannot see the
headers added by the other until the response is committed.

This commit switches the order of execution: first, the handler is
called (possibly adding HTTP headers), then the RMHA processes the
response and adds "Cache-Control" directives *only if there's no
Cache-Control header already defined*.

Issue: SPR-13867
2016-01-22 16:04:03 +01:00
Rossen Stoyanchev
ebccfd023a MVC Java config protected factory methods
This change exposes protected methods for instantiating sub-classes of
RequestMappingHandlerAdapter and ExceptonHandlerExceptionResolver
similar to the existing method for RequestMappingHandlerMapping.
2016-01-22 09:48:50 -05:00
Rossen Stoyanchev
9cc518d167 Polish StringHttpMessageConverterTests 2016-01-22 09:40:33 -05:00
Stephane Nicoll
cd903e26de Polish 2016-01-22 04:35:33 +01:00