Commit Graph

11599 Commits

Author SHA1 Message Date
Juergen Hoeller c1f233c787 Shared EntityManager does not insist on actualTransactionActive flag anymore
Issue: SPR-13838
(cherry picked from commit 50829c9)
2016-01-26 20:28:07 +01:00
Juergen Hoeller 77b8f4d6af ImportStack extends ArrayDeque instead of Stack and relies on standard contains implementation
Issue: SPR-13852
(cherry picked from commit e14c2de)
2016-01-26 20:27:28 +01:00
Juergen Hoeller 8516de62e3 FastByteArrayInputStream consistently returns -1 when no data available
Issue: SPR-13858
(cherry picked from commit 5d4547d)
2016-01-26 20:26:44 +01:00
Brian Clozel bcebc9db7e 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
cherry-picked from 84fe46cd
2016-01-22 19:03:52 +01:00
Brian Clozel fc34b0c592 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
cherry-picked from 8f1d06f19
2016-01-22 16:36:48 +01:00
Brian Clozel a4cb3cf900 Fix OutOfBoundsException 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
cherry-picked from 2f6d86b7
2016-01-21 17:39:37 +01:00
Rossen Stoyanchev 33112df237 Fix second failing test 2016-01-20 23:13:34 -05:00
Rossen Stoyanchev e159086201 Fix failing test 2016-01-20 21:39:41 -05:00
Rossen Stoyanchev ab16adab2e Avoid double encoding URI in ServletServerHttpRequest
Issue: SPR-13876
2016-01-20 17:58:07 -05:00
Ian Chan 29692fcc21 Catch RejectedExecutionException in WebAsyncManager
Issue: SPR-13836
2016-01-14 15:50:20 -05:00
Rossen Stoyanchev 73df50db3c Fix javadoc issue in ResponseEntityExceptionHandler
Issue: SPR-13869
2016-01-14 14:28:15 -05:00
Brian Clozel 3af62bd0dd Polish
Issue: SPR-13817
(cherry picked from d681f77d)
2016-01-05 17:33:04 +01:00
Brian Clozel 1581597092 Preserve ETag HTTP header for versioned resources
Prior to this change, a resource handler chain configured with a
`VersionResourceResolver` would add the resource version to the request
attributes when serving that resource. This approach would not work when
a `CachingResourceResolver` is configured and the resource is already
cached. Indeed, that code path is not executed when the resource is
resolved from the cache.

This commit adds a new `VersionedResource` interface that's used by the
`VersionResourceResolver`, adding a `getVersion()` method that returns
the version string for that resource. This way, the version information
is cached with the resource itself and the request attributes are no
longer used for this.

Issue: SPR-13817
(cherry picked from commit 473cf9c)
2016-01-05 15:04:05 +01:00
Juergen Hoeller 84e5234eb5 Avoid getTypeForFactoryBean warn logging for lazy-init beans
Issue: SPR-13833
(cherry picked from commit 04f3181)
2015-12-31 11:52:55 +01:00
Juergen Hoeller 24e58c1ac3 Refined RequestMappingHandlerMapping bean definition
Issue: SPR-13832
(cherry picked from commit 9bffb9e)
2015-12-31 11:52:47 +01:00
holub 15da48eba5 Update SockJS client code snippet 2015-12-30 10:29:01 +01:00
Juergen Hoeller 342d760f70 Polishing
(cherry picked from commit 27c2e8c)
2015-12-29 21:51:04 +01:00
Juergen Hoeller acecda7153 Avoid sensitive Proxy.getInvocationHandler call in synthesizeAnnotation
Issue: SPR-13829
(cherry picked from commit aecb8b6)
2015-12-29 21:50:49 +01:00
Juergen Hoeller 4a863c9066 Upgrade to Undertow 1.3.11
(cherry picked from commit 873b173)
2015-12-29 11:26:52 +01:00
Juergen Hoeller 35b8696523 Polishing 2015-12-29 11:24:56 +01:00
Juergen Hoeller e1bdf5577e StatementCreatorUtils always tries getParameterType on Oracle 12c driver
Issue: SPR-13825
(cherry picked from commit e48ec4f)
2015-12-29 11:23:49 +01:00
Juergen Hoeller deae872912 Consistent use of varargs plus related polishing 2015-12-22 23:50:05 +01:00
Juergen Hoeller 36940e003d Polishing 2015-12-21 22:38:25 +01:00
Juergen Hoeller 935d714333 SimpleNamespaceContext implements all subtleties of the NamespaceContext contract
Issue: SPR-13713
(cherry picked from commit f8860e2)
2015-12-21 22:35:47 +01:00
Juergen Hoeller 9021f8fd71 Upgrade to JavaMail 1.5.5 and Hibernate ORM 5.0.6
(cherry picked from commit 06056e6)
2015-12-21 22:35:23 +01:00
Juergen Hoeller 6f2f3595e9 Backported import and declaration cleanup 2015-12-18 00:18:09 +01:00
Juergen Hoeller d59a97c101 Polishing 2015-12-18 00:02:48 +01:00
Juergen Hoeller 7344dd259c Allow for explicit spring-websocket-4.2.xsd declarations
Issue: SPR-13804
2015-12-18 00:02:14 +01:00
Juergen Hoeller f3ac64153e Correct spring-websocket-4.2 versus spring-websocket-4.1 xsd declarations
Issue: SPR-13804
(cherry picked from commit 2fd48c9)
2015-12-17 18:34:47 +01:00
Stephane Nicoll 7b35103135 Switch to 4.2.5.BUILD-SNAPSHOT 2015-12-17 12:53:44 +01:00
Juergen Hoeller 935c0a463e Revised MockMvcResultHandlers logger initialization
Issue: SPR-13802
2015-12-16 21:49:48 +01:00
Juergen Hoeller 62caa3c3b8 Upgrade to OkHttp 2.7 and TestNG 6.9.10 2015-12-16 21:02:37 +01:00
Juergen Hoeller 753347ea98 Consistent static final logger declarations 2015-12-16 20:44:00 +01:00
Juergen Hoeller 997278e3ed Polishing 2015-12-16 20:19:41 +01:00
Rossen Stoyanchev c8aa48faa9 Add params(MultiValueMap) to MockMvc
Issue: SPR-13801
2015-12-16 11:51:59 -05:00
Juergen Hoeller 5626384812 Consistent trace log messages and general polishing 2015-12-16 15:59:02 +01:00
Brian Clozel 3be35c053d Use LinkedHashmap to preserve insert order
In several places in the spring-webmvc module, URL patterns / objects
relationships are kept in `HashMap`s. When matching with actual URLs,
the algorithm uses a pattern comparator to sort the matching patterns
and select the most specific. But the underlying collection
implementation does not keep the original order which can lead to
inconsistencies.

This commit changes the underlying collection implementation to
`LinkedHashmap`s, in order to keep the insert order if the comparator
does not reorder entries.

Issue: SPR-13798
2015-12-16 15:24:35 +01:00
Juergen Hoeller 5d454d5ea7 Polishing 2015-12-15 15:59:30 +01:00
Juergen Hoeller 9e03e0e73d Polishing 2015-12-15 11:53:40 +01:00
Juergen Hoeller b880b4a545 Upgrade to Castor 1.4 2015-12-15 11:53:28 +01:00
Rossen Stoyanchev 457fca40f0 Update CONTRIBUTING.md 2015-12-14 14:07:13 -05:00
Rossen Stoyanchev b21e64448b Update CONTRIBUTING.md 2015-12-14 11:11:31 -05:00
Rossen Stoyanchev 1f6596d1e3 Update CONTRIBUTING.md 2015-12-14 11:05:48 -05:00
Rossen Stoyanchev ea01b389ba Update CONTRIBUTING.md 2015-12-14 11:05:06 -05:00
Rossen Stoyanchev a0bba453da Add comment to use Stack Overflow before JIRA 2015-12-14 11:04:42 -05:00
Juergen Hoeller a36c0a50e6 Defensive error reporting when StandardAnnotationMetadata introspects declared methods
Issue: SPR-13791
2015-12-14 15:13:29 +01:00
Juergen Hoeller 21329df7e1 Polishing 2015-12-14 00:56:06 +01:00
Juergen Hoeller bdb606b8b1 Polishing 2015-12-13 23:27:05 +01:00
Juergen Hoeller ef1e17fd15 Polishing 2015-12-13 01:14:38 +01:00
Juergen Hoeller 04f765506e Fine-tuned method/field access checks 2015-12-13 01:10:01 +01:00