Commit Graph

9888 Commits

Author SHA1 Message Date
Rossen Stoyanchev
9c3580d04e Disable DTD when parsing untrusted XML input
Issue: SPR-13136
2015-06-30 08:58:03 -04:00
Juergen Hoeller
a837cbe81f Latest applicable dependency updates (Netty 4.0.29, Undertow 1.1.7) 2015-06-30 14:54:12 +02:00
Juergen Hoeller
f1b42b7d8f ContentCachingResponseWrapper defensively applies content length in case of sendError/sendRedirect
Issue: SPR-13004
(cherry picked from commit 4facb2f)
2015-06-30 14:25:57 +02:00
Juergen Hoeller
3d131c9f3c YamlProcessor explicitly closes UnicodeReader
Issue: SPR-13173
(cherry picked from commit 26acb48)
2015-06-30 14:18:06 +02:00
Sam Brannen
a8ac6db43b Polish resource chain documentation 2015-06-29 16:16:34 +02:00
Brian Clozel
bf94344139 document XML attributes in mvc:resource-chain
Issue: SPR-12804
2015-06-29 15:35:14 +02:00
Brian Clozel
b3f01998d2 Fix NPE in GzipResourceResolver
This change fixes a NullPointerException in GzipResourceResolver, which
assumed that calls to the `resolveResource` method were made with only
non-null values for request.

This is not the case for the VersionResourceResolver, which tries to
resolve resources that aren't requested per se by the HTTP request.

Issue: SPR-13149
2015-06-22 11:45:57 +02:00
Martin Lippert
8dd182f76c Fix exception in AntPathMatcher for leading *
Issue: SPR-13139
2015-06-17 16:19:59 -04:00
Juergen Hoeller
b731f7ad15 ObjenesisCglibAopProxy catches NoClassDefFoundError as well
Issue: SPR-13131
2015-06-17 16:54:56 +02:00
Juergen Hoeller
9dea9d57db Polishing 2015-06-17 14:52:31 +02:00
Juergen Hoeller
c85127d3f8 TransactionAttributeSourcePointcut pointcut skips target classes with TransactionalProxy marker (e.g. Spring Data proxies)
Issue: SPR-13109
2015-06-17 14:52:21 +02:00
Juergen Hoeller
846fae241b Fixed fallback mode in ObjenesisCglibAopProxy
Issue: SPR-13131
2015-06-17 14:49:34 +02:00
Juergen Hoeller
d08c0669da Polishing 2015-06-16 01:42:51 +02:00
Juergen Hoeller
13a2ae27e1 Latest dependency updates (H2 1.4.187, Joda-Time 2.8.1) 2015-06-16 01:42:43 +02:00
Juergen Hoeller
ef9910c3c4 ConfigurationClassParser ignores unresolvable member classes
Issue: SPR-13115
(cherry picked from commit 1c01f57)
2015-06-16 01:42:35 +02:00
Sam Brannen
33b9bd72cc Proper support for Root WAC in Spring MVC Test
The modifications to DefaultMockMvcBuilder performed in conjunction
with SPR-12553 introduced a breaking change: the WebApplicationContext
supplied to DefaultMockMvcBuilder's constructor was *always* stored in
the ServletContext as the root WebApplicationContext, overwriting a
root WebApplicationContext that had been set by the user or by the
Spring TestContext Framework (TCF) -- for example, in
AbstractGenericWebContextLoader. Consequently, the changes in SPR-12553
cause tests that use @ContextHierarchy to fail if web components rely
on the correct WebApplicationContext being stored under the
WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE key.

This commit reverts the breaking changes introduced in SPR-12553: if
the root WebApplicationContext has already been set in the
ServletContext of the WebApplicationContext supplied to
DefaultMockMvcBuilder, no action is taken.

Furthermore, this commit introduces new code to address the initial
intent of SPR-12553. Specifically, if the root WebApplicationContext
has NOT been set in the ServletContext of the WebApplicationContext
supplied to DefaultMockMvcBuilder, the application context hierarchy
will be traversed in search of the root WebApplicationContext, and the
root WebApplicationContext will then be stored under the
ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE key.

Issue: SPR-13075, SPR-12553
(cherry picked from commit f6d2fe471a)
2015-06-12 21:38:34 +02:00
Juergen Hoeller
bccdefdf30 Polishing 2015-06-11 18:01:00 +02:00
Juergen Hoeller
2109db0c02 Stronger warning about lookup methods not working with @Bean
Includes an updated CGLIB AOP proxy note on constructor invocations.

Issue: SPR-13108
Issue: SPR-13103
2015-06-11 18:00:12 +02:00
Juergen Hoeller
6f7ad3b1c0 WebAsyncUtils avoids reflection for creating StandardServletAsyncWebRequest
Issue: SPR-13112
(cherry picked from commit 32b9ea9)
2015-06-11 17:59:30 +02:00
Juergen Hoeller
84ae28b2bb AspectJExpressionPointcut defensively catches exceptions thrown from ShadowMatch.matchesJoinPoint
Issue: SPR-13102
(cherry picked from commit 75edb39)
2015-06-11 17:58:44 +02:00
Juergen Hoeller
d2621baf0a Enabled test for AspectJ pointcut matching against lambda-defined bean
Issue: SPR-11807
(cherry picked from commit b02352d)
2015-06-11 17:57:37 +02:00
Juergen Hoeller
7a6ce1c265 Latest dependency updates (AspectJ 1.8.6, Joda-Time 2.8) 2015-06-11 17:56:01 +02:00
Juergen Hoeller
063a720ac0 Reverted enhanceFactoryBean revision in 4.1.x (making it 4.2 only)
Issue: SPR-12915
Issue: SPR-13095
2015-06-11 17:53:26 +02:00
Stephane Nicoll
3227007816 Polish
Update copyright headers
2015-06-03 11:52:45 +02:00
Stephane Nicoll
daf12a9723 Allow Cache annotations to not specify any cache name
Since Spring 4.1, a CacheResolver may be configured to customize the way
the cache(s) to use for a given cache operation are retrieved. Since a
CacheResolver implementation may not use the cache names information at
all, this attribute has been made optional.

However, a fix was still applied, preventing a Cache operation without a
cache name to be defined properly. We now allow this valid use case.

Issue: SPR-13081
2015-06-03 11:51:30 +02:00
Juergen Hoeller
b5bb26b7c6 Latest dependency updates (Jetty 9.2.11, Tomcat 8.0.23) 2015-06-02 15:15:36 +02:00
Juergen Hoeller
ae3cc67391 Lite configuration candidate check defensively handles method introspection failure
Issue: SPR-13091
(cherry picked from commit 4f1286a)
2015-06-02 15:07:01 +02:00
Juergen Hoeller
55de4a69ae SpringSessionSynchronization's beforeCompletion unbinds after disconnect failure as well
Issue: SPR-13089
(cherry picked from commit 8c337a4)
2015-06-02 15:02:34 +02:00
Juergen Hoeller
bf38b3a4fc Polishing
(cherry picked from commit 92bf32b)
2015-05-23 20:37:21 +02:00
Juergen Hoeller
aa3a78aa0e SockJsTransportFailureException provides constructor variant without session id
(cherry picked from commit e0a11f2)
2015-05-23 20:37:15 +02:00
Juergen Hoeller
6cdc208c73 Polishing 2015-05-23 00:09:58 +02:00
Juergen Hoeller
fd1b5e80a7 Latest dependency updates (Hibernate ORM 4.3.10, Netty 4.0.28) 2015-05-22 17:24:48 +02:00
Juergen Hoeller
3c6f1f8352 Polishing 2015-05-22 17:24:40 +02:00
Juergen Hoeller
c111bd7547 Message listener containers only call Session.recover() in client acknowledge mode
Issue: SPR-13052
(cherry picked from commit fee63fd)
2015-05-22 17:24:26 +02:00
Juergen Hoeller
1177f5c0a3 ByteBufferConverter explicitly declares applicability to byte[]
Includes an optimization for simple ByteBuffer duplication.

Issue: SPR-13056
(cherry picked from commit 792b7b9)
2015-05-22 17:23:57 +02:00
Stephane Nicoll
bd05e3ade2 Apply DestinationResolver to listener container
Previously, a custom `DestinationResolver` was not made available
to the underlying `MessageListener`: if a reply needs to be sent, the
default `DestinationResolver` was used.

This commit ensures that if a custom `DestinationResolver` has been set,
it is also configured accordingly for replies.

Issue: SPR-12927
2015-05-22 15:50:19 +02:00
Stephane Nicoll
bd601ce2e4 Make PropertyMatches public
Issue: SPR-13054
2015-05-21 20:20:38 +02:00
Stephane Nicoll
24783303a7 Add possible matches for field access
DirectFieldAccessor now support richer NotWritablePropertyException
content, including dedicated error message and possible matches.

Issue: SPR-13053
2015-05-21 20:20:16 +02:00
Brian Clozel
9e8e7aa6b9 Fix SPR-12999 backport (missing test dependency) 2015-05-21 15:18:49 +02:00
Brian Clozel
c99cc53da1 Fix directories I/O in ResourceHttpRequestHandler
Prior to this commit, the `ResourceHttpRequestHandler` would not
properly handle HTTP requests to **directories contained in JARs**.
This would result in HTTP 500 errors, caused by `FileNotFoundException`
or `NullPointerException`.

This can be tracked to webapp ClassLoader implementations in servlet
containers:
* in Jetty9x, fetching a directory within a JAR as a `Resource` and
getting its InputStream work fine, but attempting to `close()` it
results in a NullPointerException as the underlying stream is null.
* In Tomcat6x, one cannot fetch an InputStream for the same `Resource`
as it throws a FileNotFoundException.

This change adds more try/catch clauses and catches more Exception so as
to result in HTTP 200 OK responses instead of server errors. While this
is inconsistent because the same code path would result in HTTP 404 with
existing directories on the file system, there's no other simple way to
make those checks for resources contained in JARs.

Issue: SPR-12999
2015-05-21 14:54:55 +02:00
Rossen Stoyanchev
cd9b58b0ab Fix typo in reference
Issue: SPR-13043
2015-05-18 15:26:25 -04:00
Juergen Hoeller
ae35e84c1e Polishing
(cherry picked from commit 0711d6d)
2015-05-13 17:27:41 +02:00
Juergen Hoeller
391f72d2e4 PropertyOrFieldReference avoids NPE through defensive copy of volatile accessor reference
Issue: SPR-13023
(cherry picked from commit 9799df3)
2015-05-13 16:12:33 +02:00
Juergen Hoeller
633d13ffab Actual hasText assertion in SockJsFrame
Issue: SPR-13019
(cherry picked from commit 02d28ae)
2015-05-13 16:11:59 +02:00
Juergen Hoeller
ca17dc06a5 SimpleAliasRegistry prevents NPE for alias resolved to null
Issue: SPR-13016
(cherry picked from commit e83d495)
2015-05-13 16:10:53 +02:00
Brian Clozel
51c941ca11 Fix empty URLs handling in ResourceUrlEncodingFilter
Prior to this commit, the ResourceUrlEncodingFilter would fail with a
StringIndexOutOfBoundsException when:

* the current request has a servlet context
* the URL to encode is relative and is shorter than the context value

This change defensively checks for those lengths and delegates to the
parent implementation if necessary.

Issue: SPR-13018
2015-05-13 14:38:54 +02:00
Juergen Hoeller
9e925aa86c Polishing 2015-05-11 21:52:38 +02:00
Juergen Hoeller
a899e066f2 RequestResponseBodyMethodProcessor decorates ServletInputStream as well
Issue: SPR-13014
2015-05-11 21:52:30 +02:00
Brian Clozel
89694b009a Fix CachingResourceResolver key generation
When used in combination with GzipResourceResolver, the
CachingResourceResolver does not properly cache results, since it only
takes the request path as a input for cache key generation.

Here's an example of that behavior:

1. an HTTP client requests a resource with `Accept-Encoding: gzip`, so
the GzipResourceResolver can resolve a gzipped resource.
2. the configured CachingResourceResolver caches that resource.
3. another HTTP client requests the same resource, but it does not
support gzip encoding; the previously cached gzipped resource is still
returned.

This commit uses the presence/absence of gzip encoding support as an
input in cache keys generation.

Issue: SPR-12982
2015-05-11 21:18:03 +02:00
Juergen Hoeller
a8f75399f8 Javadoc fixes 2015-05-11 19:04:29 +02:00