Commit Graph

10700 Commits

Author SHA1 Message Date
Juergen Hoeller
cc0a4c1ea0 Upgrade to Jetty 9.3.1 and Undertow 1.2.9 2015-07-17 15:25:51 +02:00
Juergen Hoeller
203f1225c3 Polishing 2015-07-17 15:25:43 +02:00
Juergen Hoeller
7e2a662f63 Enforce TransactionRequiredException for pre-bound EntityManager without actual transaction active
Issue: SPR-13243
2015-07-17 15:25:29 +02:00
Juergen Hoeller
2f8ac91872 Only attempt to call joinTransaction in case of actual transaction active
Issue: SPR-13242
2015-07-17 15:24:52 +02:00
Juergen Hoeller
a8fb551b1c Allow for overriding of computeTransactionAttribute
Issue: SPR-13246
2015-07-17 15:24:24 +02:00
Juergen Hoeller
9de824b73d AllEncompassingFormHttpMessageConverter registers MappingJackson2XmlHttpMessageConverter and GsonHttpMessageConverter (for consistency with RestTemplate and WebMvcConfigurationSupport)
Issue: SPR-13240
2015-07-17 15:24:12 +02:00
Juergen Hoeller
aedef43a9a Exception fine-tuning and general polishing
Issue: SPR-13067
2015-07-17 15:24:04 +02:00
Juergen Hoeller
9f15f347bf Renamed 'name' attribute to 'scopeName' (in order to avoid common override conflicts)
Issue: SPR-13239
2015-07-17 15:23:47 +02:00
Brian Clozel
106cce58cc Fix tests
Issue: SPR-13241
2015-07-17 13:32:38 +02:00
Brian Clozel
ec5019dbae Upgrade to groovy 2.4.4 2015-07-17 11:09:56 +02:00
Brian Clozel
064abad9d8 PathResourceResolver should not resolve root path
When resolving resources, the PathResourceResolver creates a Resource
instance and checks whether this resource `exists()` and `isReadable()`.
While that last call returns false for folders on the file system, both
calls return true for folders located inside JARs.

If a JAR location is configured as a resource location, then
PathResourceResolver can resolve folders in JARs as valid locations and
candidates for paths resolution.

Prior to this change, the PathResourceResolver would resolve "" as a
valid resource path (here, the "/META-INF/resources/webjars" if
configured, for example) and return a "" path for this resource,
effectively turning all "/" URLs into empty ones "".

This commit fixes the resolveUrlPathInternal implementation by not
allowing empty paths as valid resource paths.

Issue: SPR-13241
2015-07-17 10:31:37 +02:00
Stephane Nicoll
8e479e28ce Merge pull request #839 from michalkarolik/ResultActionsJavadocFix
* pr/839:
  Fix package references
2015-07-16 11:28:38 +02:00
Michal Karolik
95fe5f9033 Fix package references
Closes gh-839
2015-07-16 11:28:12 +02:00
Stephane Nicoll
f120f22d51 Merge pull request #838 from mdeinum/SPR-13238
* pr/838:
  Update book reference
2015-07-16 09:26:48 +02:00
Marten Deinum
92663ec27b Update book reference
Closes gh-838

There is a new version of AspectJ in Action which is now mentioned in the
Further Resources section of the AOP chapter.
2015-07-16 09:25:39 +02:00
Juergen Hoeller
d183bbb667 Javadoc refinements, exception fine-tuning, general polishing
Issue: SPR-13034
2015-07-15 15:42:17 +02:00
Juergen Hoeller
2577ac300b Refined spring-oxm test execution check for compatibility with the recently announced JDK 9 version scheme
Issue: SPR-13012
2015-07-15 15:21:37 +02:00
Sebastien Deleuze
34de167e59 Support non thread-safe ScriptEngine in ScriptTemplateView
This commit adds a new sharedEngine property to ScriptTemplateConfigurer
and ScriptTemplateView in order to support non thread-safe ScriptEngine
implementations like Nashorn.

When this flag is set to false, the engine is retrieved from a
ThreadLocal<ScriptEngine> field instead of a ScriptEngine one.

Also as part of this commit, all the initialization logic has been moved from
ScriptTemplateConfigurer to ScriptTemplateView since the script engine can
now be lazily initialized multiple time in the view when sharedEngine is
set to false.

Issue: SPR-13034
2015-07-15 13:39:33 +02:00
Juergen Hoeller
0783a1c667 SpEL selection/projection works with Iterable as well
Issue: SPR-13231
2015-07-15 11:22:52 +02:00
Juergen Hoeller
ea2a1d33d9 Javadoc fixes plus additional polishing 2015-07-15 02:19:46 +02:00
Juergen Hoeller
ef781b6353 Fixed default formatters test to reliably work with any system locale
Issue: SPR-13232
2015-07-15 02:18:04 +02:00
Juergen Hoeller
2934256257 Polishing 2015-07-15 00:08:11 +02:00
Juergen Hoeller
09eb492079 Merged bean definitions are now cached early and selectively evicted after post-processing and before actual bean creation
Issue: SPR-12236
2015-07-15 00:05:39 +02:00
Juergen Hoeller
37f74e76f6 TomcatInstrumentableClassLoader supports Tomcat 7.0.63+ as well
Issue: SPR-13210
2015-07-15 00:02:55 +02:00
Juergen Hoeller
f4f508d869 Revisit date-time tests for compatibility with JDK 9 build 72
Issue: SPR-13232
2015-07-14 23:58:30 +02:00
Juergen Hoeller
48f330dd31 AspectJ 1.9 beta 1 for ajc task (for JDK 9 build compatibility)
Plus latest dependency updates (Hibernate ORM 5.0 RC2, Jackson 2.6 RC4, Reactor 2.0.4, Tomcat 8.0.24, C3P0 0.9.5.1, Rome 1.5.1, FreeMarker 2.3.23, JRuby 1.7.21)

Issue: SPR-13012
2015-07-14 23:56:09 +02:00
Sam Brannen
649d145103 Merge pull request #835 from ndebeiss/master
* ndebeiss-master:
  Support single quotes nested in double quotes in SQL scripts
2015-07-14 15:29:31 +03:00
ndebeiss
629bcb6599 Support single quotes nested in double quotes in SQL scripts
Some databases such as Oracle permit double quoted column aliases that
contain case-sensitive characters, single quotes, and other special
characters; however, prior to this commit, SqlScripts interpreted a
single quote nested within double quotes as the start of a string
literal resulting in improper parsing.

This commit addresses this issue by ensuring that double quoted strings
such as column aliases are properly parsed even when containing single
quotes.

Issue: SPR-13218
2015-07-14 15:01:01 +03:00
Stephane Nicoll
de6bbe7797 Handle null header value property
When using an Apache Http components based infrastructure, a null header
value is handled as the empty string. The exact same infrastructure using
HttpURLConnection generates a header with no colon. This is actually not
proper HTTP and some components fail to read such request.

We now make sure to call HttpURLConnection#addRequestProperty with the
empty String for a null header value.

Issue: SPR-13225
2015-07-14 10:34:28 +02:00
Juergen Hoeller
bdb63483df Common DataWithMediaType class and common synchronization for ResponseBodyEmitter/SseEmitter
Issue: SPR-13223
Issue: SPR-13224
2015-07-14 00:08:40 +02:00
Juergen Hoeller
1fcd465f2d DelegatingFilterProxy autodetects a unique DispatcherServlet context
Issue: SPR-13191
2015-07-13 21:34:07 +02:00
Juergen Hoeller
e0329306df JdbcTemplate's queryForObject allows for specifying primitive types as well
Issue: SPR-13220
2015-07-13 21:30:57 +02:00
Juergen Hoeller
8fdbf4285b Jackson2ObjectMapperBuilder prefers Jackson 2.6 JavaTimeModule over JSR310Module
Issue: SPR-13212
2015-07-13 17:41:57 +02:00
Juergen Hoeller
18c4671318 JAXB scan skips annotated interfaces
Issue: SPR-13221
2015-07-13 14:59:53 +02:00
Juergen Hoeller
41b58584ea BeanPropertyRowMapper uses US locale for lower-case conversion by default
Issue: SPR-13216
2015-07-13 14:59:43 +02:00
Juergen Hoeller
c7fef87e76 ResourceBundleThemeSource exposes fallbackToSystemLocale and defaultEncoding
Issue: SPR-13209
2015-07-13 14:59:35 +02:00
Stephane Nicoll
d738dddd8f Add createDispatcherServlet hook point
Add an extra hook point in `AbstractDispatcherServletInitializer` to
customize the `DispatcherServlet`.

Issue: SPR-13222
2015-07-13 14:43:06 +02:00
Sebastien Deleuze
84138abfd1 Avoid rejecting same-origin requests detected as CORS requests
Browsers like Chrome or Safari include an Origin header for same-origin
POST/PUT/DELETE requests, not only for cross-origin requests.

Before this commit, these same-origin requests would have been detected
as potential cross-origin requests, and rejected if the same-origin domain
is not part of the configured allowedOrigins.

This commit avoid to reject same-origin requests by reusing the logic
introduced in Spring 4.1 for detecting reliably Websocket/SockJS
same-origin requests with the WebUtils.isValidOrigin() method. This
logic has been extracted in a new WebUtils.isSameOrigin() method.

Issue: SPR-13206
2015-07-13 10:59:19 +02:00
Sebastien Deleuze
882fe129f3 Polish CORS support 2015-07-10 16:42:50 +02:00
Sam Brannen
9c46228a97 Populate RequestAttributes before invoking Filters in MockMvc
When using the Spring TestContext Framework (TCF) to load a
WebApplicationContext and the Spring MVC Test Framework (MockMvc) to
test a controller, two instances of MockHttpServletRequest will be
created. Due to an ordering issue with regard to population of the
RequestAttributes, it is therefore possible that a filter accesses the
mocked request managed by the TCF, while the controller accesses the
mocked request managed by MockMvc, and this leads to test failures if
the controller expects data from the filter to be present in the
request.

This commit fixes this bug by ensuring that the RequestAttributes
backed by the mocked request managed by MockMvc are stored in the
RequestContextHolder before any filters are invoked by MockMvc.

Issue: SPR-13217
2015-07-10 17:35:05 +03:00
Sam Brannen
3d951755fa Improve documentation for @IfProfileValue precedence
Issue: SPR-11902
2015-07-10 02:38:54 +03:00
Sebastien Deleuze
cd9b3903a7 Introduce CorsFilter and CorsConfigurationMapping
This commit introduces the following changes:
 - The new CorsConfigurationMapping class allows to share the mapped
   CorsConfiguration logic between AbstractHandlerMapping and CorsFilter
 - In AbstractHandlerMapping, the Map<String, CorsConfiguration>
   corsConfiguration property has been renamed to corsConfigurations
 - CorsFilter allows to process CORS requests at filter level, using any
   CorsConfigurationSource implementation (for example
   CorsConfigurationMapping)

Issue: SPR-13192
2015-07-09 22:19:46 +02:00
Sebastien Deleuze
df9290c00d Improve DispatcherServlet diagrams
Issue: SPR-13120
2015-07-09 17:03:10 +02:00
Sam Brannen
c1b5262824 Upgrade to Gradle 2.5
Issue: SPR-13012
2015-07-09 17:18:56 +03:00
Brian Clozel
8e566026e0 RedirectViews should always use RESPONSE_STATUS_ATTRIBUTE
By default, RedirectViews have http10Compatible set to true, which means
that they use HTTP 302 as a default HTTP response status. Setting this
property to false make RedirectViews use HTTP 303 by default.

Now when set to false, RedirectViews also don't use the
RESPONSE_STATUS_ATTRIBUTE request attribute as a response HTTP if it is
available.

This commit makes both configuration choices behave the same regarding
this request attribute: use it as a response status if it's available.

Issue: SPR-13208
2015-07-09 12:11:22 +02:00
Stephane Nicoll
de6a649071 Polish 2015-07-09 11:29:48 +02:00
Sam Brannen
2e41c2e23d Polish Javadoc in @EventListener 2015-07-08 18:40:08 +02:00
Sam Brannen
72f0ac7e5b Polish Javadoc in @EventListener 2015-07-08 18:33:35 +02:00
Stephane Nicoll
fd2c0cc982 Polish 2015-07-08 18:09:16 +02:00
Sam Brannen
14e168f2dc Fix typos in @EventListener 2015-07-08 15:19:47 +02:00