Commit Graph

11514 Commits

Author SHA1 Message Date
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
Andy Clement
a12f23936c Allow use of '&' prefix to access factory bean in SpEL
Prior to this change SpEL did not have an syntactic
construct enabling easy access to a FactoryBean. With this
change it is now possible to use &foo in an expression when
the factory bean should be returned.

Issue: SPR-9511
2016-01-21 16:14:16 -08:00
Rossen Stoyanchev
415b2763ce MockHttpServletRequestBuilder parses form data
Spring MVC Test now parses application/x-www-form-urlencoded request
content and populates request parameters from it.

This can be useful when running client-side tests against a MockMvc
via MockMvcClientHttpRequestFactory.

Issue: SPR-13733
2016-01-21 17:26:23 -05:00
Rossen Stoyanchev
6a9455b7d0 Fix failing test 2016-01-21 17:05:05 -05:00
Rossen Stoyanchev
1416c2a00e ContentRequestMatchers asserts request with form data
Issue: SPR-13044
2016-01-21 12:42:33 -05:00
Brian Clozel
2f6d86b7aa Fix OutOfBoundsExceptio in ResourceUrlEncodingFilter
Prior to this change, the `ResourceUrlEncodingFilter` would try to
lookup resources URLs as soon as the given URL would be longer than the
expected context+servlet prefix path. This can lead to
OutOfBoundsExceptions when the provided URL does not start with that
prefix and still has the required length.

This commit makes sure that all candidate URLs for resources lookup are
prefixed with the cached servlet and context path. This underlines the
fact that the `ResourceUrlEncodingFilter` does not support relative URLs
for now and delegates to the native servlet implementation in that case.

Issue: SPR-13861
2016-01-21 17:28:29 +01:00
Rossen Stoyanchev
952a3170e6 HeaderResultMatchers supports multi-value headers
Issue: SPR-10087
2016-01-21 11:19:43 -05:00
Rossen Stoyanchev
ae224bed3e Polish HeaderResultMatchers 2016-01-21 10:20:04 -05:00
Rossen Stoyanchev
18db77da7c Merge pull request #927 from ksokol-improvement/SPR-13719 2016-01-21 09:14:27 -05:00
Rossen Stoyanchev
df223eb118 Polish custom HTTP verb in Spring MVC Test
Issue: SPR-13719
2016-01-21 09:13:33 -05:00
Kamill Sokol
3554348919 Support custom HTTP verbs in Spring MVC Test
Prior to this commit, Spring MVC Test only supported HTTP methods GET,
POST, HEAD, OPTIONS, PUT, PATCH, DELETE, TRACE and multipart file
upload. This change adds generic methods to MockMvcRequestBuilders in
order to allow testing of arbitrary HTTP methods in a Spring MVC
application.

Issue: SPR-13719
2016-01-21 09:12:43 -05:00
Rossen Stoyanchev
9e16cbda4c Polish ServletServerHttpRequest change 2016-01-20 17:50:36 -05:00
Sammy Chu
5185953f29 Avoid double encoding URI in ServletServerHttpRequest
Issue: SPR-13876
2016-01-20 17:42:40 -05:00
Rossen Stoyanchev
a5f4aa6824 Add HttpStatus to ModelAndView
Issue: SPR-13560
2016-01-20 16:54:05 -05:00
Stephane Nicoll
29700658d4 Support Quartz trigger without JobDetail
This commit allows to create a Quartz trigger implementation via
either `CronTriggerFactoryBean` or `SimpleTriggerFactoryBean` even if no
job detail is provided.

Issue: SPR-13604
2016-01-19 18:03:03 +01:00
Stephane Nicoll
0d04af14f8 Refine test
Issue: SPR-13837
2016-01-19 15:11:58 +01:00
Stephane Nicoll
9b9df6a744 Add test
Issue: SPR-13837
2016-01-19 14:40:52 +01:00
Stephane Nicoll
714ae2684c Support for global separator in JDBC namespace
Previously, if a database needs to be initialized with several scripts
and many (or all) use a custom separator, said separator must be repeated
for each script.

This commit introduces a `separator` property at the parent element level
that can be used to customize the default separator. This is available
for both the `initialize-database` and `embedded-database` elements.

Issue: SPR-13792
2016-01-18 16:09:07 +01:00
Stephane Nicoll
eb49f3c225 Add interface-based detection test
Add a test that explicitely validates that `@ManagedResource` and friends
can be set on an interface.

Issue: SPR-13138
2016-01-18 14:14:17 +01:00
Stephane Nicoll
a112557dc4 Support SendTo at class-level
Issue: SPR-13578
2016-01-16 16:34:02 +01:00
Rossen Stoyanchev
73a794336c Support @ResponseStatus on controller type level
Issue: SPR-13547
2016-01-15 17:15:34 -05:00
Rossen Stoyanchev
4b1183582a Add methodCall option to HandlerResultMatchers
Issue: SPR-13736
2016-01-15 12:44:00 -05:00
Rossen Stoyanchev
1320da906b Polish HandlerResultMatchers 2016-01-15 12:44:00 -05:00
Juergen Hoeller
74c07d3085 Removed JavaVersion checks from spring-core tests (for JDK 9 compatibility)
Issue: SPR-13344
2016-01-15 17:45:37 +01:00
Juergen Hoeller
182b1e99e3 TODO marker for test which fails as of AspectJ 1.9 beta 3
Issue: SPR-13839
2016-01-15 17:43:59 +01:00
Stephane Nicoll
dc8de51408 Json view support for JMS
Support of @JsonView on @JmsListener annotated method that uses the
jackson converter. Also update MappingJackson2MessageConverter to offer
a public API to set the JSON view to use to serialize a payload.

Issue: SPR-13237
2016-01-15 17:18:14 +01:00
Juergen Hoeller
cdc9bf76a9 SessionDisconnectEvent actually preserves given session user
Issue: SPR-13871
2016-01-15 17:03:17 +01:00
Juergen Hoeller
9761af9ad8 Validate @RequestMapping methods on AOP proxies
Issue: SPR-13842
2016-01-15 17:01:58 +01:00
Juergen Hoeller
c1352c1201 Upgrade to AspectJ 1.9 beta 3 (for build compatibility with JDK 9 build 95+)
Issue: SPR-13839
2016-01-15 17:01:10 +01:00
Stephane Nicoll
2fc2c29e9a Update copyright header 2016-01-15 10:51:11 +01:00
Rossen Stoyanchev
3dae3fd8a9 Refine ListenableFutureCallback policy for exceptions
This change updates all cases where callbacks are invoked to catch and
suppress errors (since there is not match to do with and error from
a callback be it success or failure).

Also updated is the contract itself to clarify this and emphasize the
callbacks are really notifications for the outcome of the
ListenableFuture not the callbacks themselves.

Issue: SPR-13785
2016-01-14 17:49:01 -05:00
Rossen Stoyanchev
037f351efd Replace anonymous impls with ListenableFutureAdapater
Before this change AsyncRestTemplate had two anonymous implementations
of ListenableFuture that were adapting the result. Those have been
replaces with ListenableFutureAdapter.

This commit is preparation for SPR-13785.
2016-01-14 16:47:55 -05:00
Ian Chan
93298fc9fa Catch RejectedExecutionException in WebAsyncManager
Issue: SPR-13836
2016-01-14 15:47:00 -05:00
Rossen Stoyanchev
4818378c25 Better document client-side tests against MockMvc
Issue: SPR-13815
2016-01-14 15:15:07 -05:00
Rossen Stoyanchev
7690f27c5e Add MediaType constants for application/pdf
Issue: SPR-13831
2016-01-14 14:57:09 -05:00
Rossen Stoyanchev
f3c2bb6557 Fix error message in RestTemplate
Issue: SPR-13860
2016-01-14 14:52:10 -05:00
Rossen Stoyanchev
24fdf64d91 Fix javadoc issue in ResponseEntityExceptionHandler
Issue: SPR-13869
2016-01-14 14:25:30 -05:00
Rossen Stoyanchev
e56587dcc3 Add note to @CrossOrigin javadoc
Issue: SPR-13857
2016-01-14 14:13:53 -05:00